Question: In this assignment you will create two Java programs: The first program will be a class that holds information (variables) about an object of your

In this assignment you will create two Java programs:

The first program will be a class that holds information (variables) about an object of your choice and provides the relevant behavior (methods)

The second program will be the main program which will instantiate several objects using the class above, and will test all the functions (methods) of the class above.

You cannot use any of the home assignments as your submitted assignment.

Your programs must meet the following qualitative and quantitative criteria:

Your class must:

Contain at least 5 instance variables (0.5 marks)

Contain at least 2 methods other than the constructor (2 marks)

Provide a toString() method to print the data of an object in an appropriately formatted string (this does not count as one of the two methods above). (0.5 marks)

The main program must:

Read its data from System.In using a sentinel value to detect the end of the input. (1 mark)

Ensure that input errors will be handled correctly (0.5 marks)

Instantiate an array of objects of your class above, using the data input by the user to construct the objects (0.5 marks)

Test both methods of the class above (1 mark)

Print the content of the object array using the formatted printing method provided by the class (1 mark)

Have correct style (use of the standard template, use of comments, correct alignment of statements, good choice of names, appropriate use of case) (1 mark) I really hope if I can get some actual examples for each requirement, Thank you very much :)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!