April 19, 2015

Homework Help: java programming

Posted by JJ on Thursday, January 20, 2011 at 5:41am.

Provide a class called Letter for authoring a simple letter. The letter class has three data fields, the name of the sender, the name of the recipient, a body of the letter.
1. Supply the class constructors (default , and overloaded )
2. Supply a method.
Public void addLine (String Line)

To add a line of text to the body of the letter
The addLine method should through an exception if the line is empty.
3. Supply a method.
Public String getText()

That returns the entire text of the letter.The text has the form :
Dear recipient name:
Blank Line
First line of the body
Second line of the body

Last line of the body
Blank line
Blank line
Sender name
4. Also supply a program LetterPrinter that asks the user to enter lines of text nd verifies that the lines are not empty and prints the following letter :
Dear teacher:
Line supplied by the user
Line supplied by the user

Student name

Answer this Question

First Name:
School Subject:

Related Questions

human resources - at school i was asked to write a job letter. this letter will ...
English - 1. According to 'spacing words', write the following right. ...
history - need these letters unscrambled to make a nine letter word relating to ...
Grammar - What exsits or orcurrs in space that is 19 spaces long. The sencond ...
Discrete Math - Can someone help? Very confused. . . John Sununus was once the ...
Discrete Math - Hi there I'm confused as to how to start this problem, any help ...
French - Our French class was given an assignment where each student would write...
english - name a breakfast food that begins with the letter k also the letter a
English - I'm a 7 Letter Words, You Read me daily, My 5, 6, 7th Letter increases...
uop - the different strategies and techniques used in writing a good-news letter...