create program on eclips java
For this report: • The number of columns is 60. • The content of the post/reply must be word wrapped. • A reply must have a left margin which is a 4 space indent from its parent post. • If needed, truncate the length of the subject line to the remaining width of a page.
Likewise for the "by" line. • Note the "by" line lists only the member's first initial and last name.
Write a test program to thoroughly test your class. You do not need to use the example above (if you do the dates will at least be different). However, make sure your example has:
• At least 3 posts to the forum • One post to the forum has no replies • One post to the forum has at least 2 level of replies (a reply to a reply) • One post to the forum has at least 2 replies on the same level • For replies use a subject line the subject line to which it is a reply pre-pended with "Re: ". • Demonstrate that your word wrapping is working for at least to levels. • Print both a summary report and a detailed report • One forum is sufficient
To assist in this assignment, a class called RDate is available on the T:\ cosc21 O. This class will generate simulation data where is instantiation of an RDate is 2 minutes to one hour later than the previous instantiation.
Additional specification: • Use RDate for the date of the post and replies. Do not pass it in as an argument in the
constructor. Instead create an new RDate instance inside the constructor. • In the forum defined an addPost method which takes as an argument a member, a subject
line, and a content string (which could be very long). Have the method create an instance of a post and add it to the array. Return the instance of the post. (this will allow the test program to add replies to the replies)
• In the post class provide an addReply method which takes as an argument a member and a content string. Have the method create an instance of a post and add it to the array. Use the current posts subject line to generate the subject line for the new post. Return the instance of the post. (this will allow the test program to add replies to the replies)
• Inyour forum, have a private method that will print the first 5 lines of a report (these are the same between the two reports except for the second line). Call the method from the other two report methods to print the report header.
• No print should appear after the 50th column. • Abide by good programming practices (e.g., naming conventions, javadoc, indentation,
use of braces, etc.).