Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help asap java COSC 210-Object Oriented and GUI Programming Assignment 4 Problem Statement med boards/forums, such as stackoverflow and techiest forums, provide a means

need help asap image text in transcribed
image text in transcribed
image text in transcribed
java
COSC 210-Object Oriented and GUI Programming Assignment 4 Problem Statement med boards/forums, such as stackoverflow and techiest forums, provide a means for viduals to ask technology questions Others may then post their answers. m a forum is typically performed on-line and recorded. For this assignment it is report is to be printed on paper that has a fix width reports of all communication that has been recorded in a forum. Since the printed on paper that has a fix width the text of a post needs to be printed in a wrapped format. Furthermore, answers need to be printed with 4 space indentation, communication in a forum is typically perfor desired to provide reports of all communication that Assignment Discussion Forum Owned by David T Smith No Questions: 3 Questions 0 Or blank by B. Blue on 2/16/15 08:30pm When printing the time logs does it matter if we have a 0 or do you want a blank space in the overtime column ? Re: D Or blank by D. Smith on 2/16/15 08:32 pm I want to see a blank printed when the number of hours is Zero. Consider using in the format string and using the ternary operator when providing a value for the argument. Re: 0 or blank by J. Green 2/16/15 08:50pm An it could be used, but I think: n -- 0 ? "" : String.valueof(n) Would be simpler Problems with formatting. by C. Hope on 2/12/15 01:52 pm I can't get normal hours to print. My code inside my print method: System.out.printf("Normal Hours worked: 1500 ", timeLog.getNormal Hours()); Re: Problems with formatting. by D. Smith on 2/13/15 04:52 am Not sure what your problem is. The 850d looks odd. Should it be more like 85d? That is only 5 digits wide not 50. Reminder - javadoc and formatting by D. Smith on 2/07/15 04:59pm Reminder, Make sure you have javadoc before the class declaration and before every public method. Make sure you Use good formatting. many anns and annon Develop classes to renresent a forum questions, ans short one line title for the forum, and member consists of ONE argument by and optional middle initial and the (which can be a very long string of was posted. An answer contains long string of text), and a date/ m, questions, answers, and members. A forum is to have a om, and the member owning the forum. Have the constructor for a argument which is the member's full name fie.. first name followed W al and then a last name). A question contains a subject line, content me string of text), the member creating the question, and the date/time if "contains a member providing an answer an answer which can be a very ), and a datetime the answer was posted Note a forum can have many questions, and each question For this report: how many answers The number of columns is 60. he content of the question/question must be separated into paragraphs with each paragraph word wrapped. A new line character (ie, ) is used to separate paragraphs. An answer must have a left margin which is a 4 space indent from its question. 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. To assist in this assignment, a class called RandomDate is available on moodle and on TA COSC210. This class has a static method next which will generate simulation data where the returned LocalDate Time is 2 minutes to one hour later than the previous call. Additional specification: Create a class TextWrapper. The Text Wrapper is to have three static methods printChar(char c, int n) print Wrap(String text, int leftMargin, int rightMargin) printCentered(String text, int rightMargin) prin/Char is to print the character en times. Use this to print margins and to print horizontal lines using print Wrap is to print the text as a set of word wrapped paragraphs between the left and right column margins. Text composing paragraphs are separated by new line characters in the input text parameter. When printing the paragraphs are separated by blank lines. The printReport method in forum must use this class to print the word wrapped content printCentered is to print the text on a line centered between a left margin of O and the specified right margin. When printing the reports, use this method to print the first hea lines. Note that since these methods are static, do not create an instance of TextWrapper to u them. Simply call the methods using the class name. Use RandomDate for the date of the questions and replies. Do not pass it in as an argument in the constructor. Instead create a new RandomDate using RandomDate.nl inside the constructor of questions and replies. In the forum define an addOuestion 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 question and add it to the array Return the instance of the question. (this will allow the test program to add replies to the replies) In the question class provide an add Answer method which takes as an argument a member and a content string. Have the method create an instance of an answer and add it to the array. Use the questions subject line to generate the subject line for the answer. No print should appear after the 60 column. Abide by good programming practices (eg, naming conventions, javadoc, indentation, use of braces, etc.). Write a test program to test the TextWrapper class. Write a test program to thoroughly test your forum classes. 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 replies For replies use a subject line the subject line to which it is a reply pre-pended with "Re: Print the report One forum is sufficient Bonus 10 points. Allow answers to be posted to answers. That is answer to answer, answer to answers to answers, and so forth. The report is to show answers to answers indented an additional 4 spaces to the parent answer. The title is the have RE: prepended to the parent answer. COSC 210-Object Oriented and GUI Programming Assignment 4 Problem Statement med boards/forums, such as stackoverflow and techiest forums, provide a means for viduals to ask technology questions Others may then post their answers. m a forum is typically performed on-line and recorded. For this assignment it is report is to be printed on paper that has a fix width reports of all communication that has been recorded in a forum. Since the printed on paper that has a fix width the text of a post needs to be printed in a wrapped format. Furthermore, answers need to be printed with 4 space indentation, communication in a forum is typically perfor desired to provide reports of all communication that Assignment Discussion Forum Owned by David T Smith No Questions: 3 Questions 0 Or blank by B. Blue on 2/16/15 08:30pm When printing the time logs does it matter if we have a 0 or do you want a blank space in the overtime column ? Re: D Or blank by D. Smith on 2/16/15 08:32 pm I want to see a blank printed when the number of hours is Zero. Consider using in the format string and using the ternary operator when providing a value for the argument. Re: 0 or blank by J. Green 2/16/15 08:50pm An it could be used, but I think: n -- 0 ? "" : String.valueof(n) Would be simpler Problems with formatting. by C. Hope on 2/12/15 01:52 pm I can't get normal hours to print. My code inside my print method: System.out.printf("Normal Hours worked: 1500 ", timeLog.getNormal Hours()); Re: Problems with formatting. by D. Smith on 2/13/15 04:52 am Not sure what your problem is. The 850d looks odd. Should it be more like 85d? That is only 5 digits wide not 50. Reminder - javadoc and formatting by D. Smith on 2/07/15 04:59pm Reminder, Make sure you have javadoc before the class declaration and before every public method. Make sure you Use good formatting. many anns and annon Develop classes to renresent a forum questions, ans short one line title for the forum, and member consists of ONE argument by and optional middle initial and the (which can be a very long string of was posted. An answer contains long string of text), and a date/ m, questions, answers, and members. A forum is to have a om, and the member owning the forum. Have the constructor for a argument which is the member's full name fie.. first name followed W al and then a last name). A question contains a subject line, content me string of text), the member creating the question, and the date/time if "contains a member providing an answer an answer which can be a very ), and a datetime the answer was posted Note a forum can have many questions, and each question For this report: how many answers The number of columns is 60. he content of the question/question must be separated into paragraphs with each paragraph word wrapped. A new line character (ie, ) is used to separate paragraphs. An answer must have a left margin which is a 4 space indent from its question. 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. To assist in this assignment, a class called RandomDate is available on moodle and on TA COSC210. This class has a static method next which will generate simulation data where the returned LocalDate Time is 2 minutes to one hour later than the previous call. Additional specification: Create a class TextWrapper. The Text Wrapper is to have three static methods printChar(char c, int n) print Wrap(String text, int leftMargin, int rightMargin) printCentered(String text, int rightMargin) prin/Char is to print the character en times. Use this to print margins and to print horizontal lines using print Wrap is to print the text as a set of word wrapped paragraphs between the left and right column margins. Text composing paragraphs are separated by new line characters in the input text parameter. When printing the paragraphs are separated by blank lines. The printReport method in forum must use this class to print the word wrapped content printCentered is to print the text on a line centered between a left margin of O and the specified right margin. When printing the reports, use this method to print the first hea lines. Note that since these methods are static, do not create an instance of TextWrapper to u them. Simply call the methods using the class name. Use RandomDate for the date of the questions and replies. Do not pass it in as an argument in the constructor. Instead create a new RandomDate using RandomDate.nl inside the constructor of questions and replies. In the forum define an addOuestion 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 question and add it to the array Return the instance of the question. (this will allow the test program to add replies to the replies) In the question class provide an add Answer method which takes as an argument a member and a content string. Have the method create an instance of an answer and add it to the array. Use the questions subject line to generate the subject line for the answer. No print should appear after the 60 column. Abide by good programming practices (eg, naming conventions, javadoc, indentation, use of braces, etc.). Write a test program to test the TextWrapper class. Write a test program to thoroughly test your forum classes. 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 replies For replies use a subject line the subject line to which it is a reply pre-pended with "Re: Print the report One forum is sufficient Bonus 10 points. Allow answers to be posted to answers. That is answer to answer, answer to answers to answers, and so forth. The report is to show answers to answers indented an additional 4 spaces to the parent answer. The title is the have RE: prepended to the parent

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3. What are the current trends in computer hardware platforms?

Answered: 1 week ago