Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help out please! import java.time.LocalDateTime; import java.util.Random; public class RandomDate { static public LocalDateTime lastDateTime = null; static public Random rand = new

Can someone help out please! image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

import java.time.LocalDateTime; import java.util.Random; public class RandomDate { static public LocalDateTime lastDateTime = null; static public Random rand = new Random(); /** * Get the next LocalDateTime. First time this will be the * current date/time. Every subsequent call will return a * LocalDateTime at least 2 minutes later and at most one hour later. */ public static LocalDateTime next() { if (lastDateTime == null) { lastDateTime = LocalDateTime.now(); } else { lastDateTime = lastDateTime.plusMinutes(2 + (int) (rand.nextDouble() * 58)); } return lastDateTime; } /** * A simple main to test RandomDate. Prints the LocalDateTime from * 10 calls to next(). * * @param args not used. */ public static void main(String[] args) { System.out.println(next()); System.out.println(next()); System.out.println(next()); System.out.println(next()); System.out.println(next()); System.out.println(next()); System.out.println(next()); System.out.println(next()); System.out.println(next()); System.out.println(next()); System.out.println(next()); } } 

COSC 210-Object Oriented and GUI Programming Assignment 4 Problem Statement Specialized boards/forums, such as stack overflow and techiest forums, provide a means for individuals to ask technology questions and solicit answers. Others may then post their answers All communication in a forum is typically performed on-line and recorded. For this assignment it is desired to provide reports ofall communication that has been recorded in a forum. Since the report is to be printed on paper that has a fix width, the text of a post needs to be printed in a word wrapped format. Furthermore, answers need to be printed with 4 space indentation Develop classes to represent a forum, questions, answers, and members. A forum is to have a short one line title to the forum, and the member owning the forum. Have the constructor for a member consists of ONE argument which is the member's full name (i.e., first name followed by and optional middle initial and then a last name). A question contains a subject line, content (which can be a very long string of text), the member creating the question, and the date/time it was posted. An answer contains a member providing an answer, an answer (which can be a very long string of text), and a date/time the answer was posted. Note a forum can hav many questions, and each question can have many answers. In your forum class provide two print methods, one to print a summary of questions and the other to print the entire contents. A sample for the report produced by the summary is as follows: Assignment Discussion Forum Summary Report Owned by: David T Smith No Questions Questions #As By 0 or blank 08:30pm BTJ 16/15 Problems with formatting 2/12/15 01:52pm Reminder javadoc and format 2/07/15 04:59pm For this report: The number of columns is 60 The title for the forum is to be printed in the center of the page If needed, truncate the length of the subject line of a post to 30 characters The first By is the initials of the member posting the quetion. #Rs is the total number of replies. The On is the date and time of the initial question. This report does not show the replies themselves

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

Video Basics

Authors: Herbert Zettl

8th Edition

1305950860, 978-1305950863

Students also viewed these Databases questions

Question

1. Diagnose and solve a transfer of training problem.

Answered: 1 week ago