Question: code should be written in simple java Problem Design and implement these 4 files 1. A parent class called Person with name and id attributes-id
Problem Design and implement these 4 files 1. A parent class called Person with name and id attributes-id should be an integer Student inherits from Person and adds degree and major attributes (eg Bachelor of Science degree, major in computing science) 2. 3. Faculty inherits from Person and adds faculty and department attributes (eg Faculty of Science, computing science department) A driver file to test the 3 classes above. 4. The classes described in #1, 2 and 3 above should have the usual constructors (default and parameterized), get (accessor) and set (mutator) methods for each attribute, and a toString method Child classes should call parent methods whenever possible to minimize code duplication The driver program must test all the methods in each of the classes, Include comments in your output to describe what you are testing, for example System.out.println("testing Person toString, accessor and mutator"),. Print out some blank lines in the output to make it easier to read and understand what is being output Assignment Submission: Submit a print-out of each class file, the driver source code and a sample of the output 1. 2. Does EACH class have all the usual methods? Are all methods in EACH class tested, including child objects calling inherited parent methods? Does the child class call the parent's constructor? Does the child class override the parent's toString? Does the output produced have lots of comments explaining what is being output? Does each class, and the output, have blank lines and appropriate indenting to make them more readable? 3. 4. 5. 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
