Thursday
October 23, 2014

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

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. ...
Java Programming - I'm new to Java and I'm not sure how to write the source code...
CPE102 - Java - Can you help me with this portion of the program? Implement a ...
Java - create a java program that accepts students names, and test scores from a...
Discrete Math - Can someone help? Very confused. . . John Sununus was once the ...
math - 2.-The longest one-word name of any place in America is ...
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

Search
Members