Saturday
May 25, 2013

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
Sincerely,
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

Sincerely,
Student name

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

French - Our French class was given an assignment where each student would write...
human resources - at school i was asked to write a job letter. this letter will ...
Grammar - What exsits or orcurrs in space that is 19 spaces long. The sencond ...
history - need these letters unscrambled to make a nine letter word relating to ...
uop - the different strategies and techniques used in writing a good-news letter...
English 8R - Business Letter Assignment Help! - I have this assignment for my ...
philosophy - I am supposed to write a pursuasive letter to a european ...
writing - Describe the different strategies and techniques used in writing a ...
English - I'm a 7 Letter Words, You Read me daily, My 5, 6, 7th Letter ...
programming.Java language - Write a program to plot a face. Provide a class ...

For Further Reading

Search
Members
Community