Question: Assignment: Create a Person.java super class It should contain the following attributes: int id String title (e.g. Mr. Ms., Dr, etc.) String firstName String lastName

Assignment:

  1. Create a Person.java super class
    1. It should contain the following attributes:
      1. int id
      2. String title (e.g. Mr. Ms., Dr, etc.)
      3. String firstName
      4. String lastName
      5. Calendar birthDate
    2. It should contain the following methods
      1. Accessors (getter methods) to all attributes
      2. Mustators (setter methods) to all attributes
      3. a toString() method that returns all the objects contents in a concatenated, readable string.
      4. a displayName() method that returns a String in the following sample format: Mr. John Doe.
      5. Over-loaded constructers: no-arg and one that accepts all 5 project attributes

  1. Create a Student.java child that inherits from person. It should contain a classification attribute (freshman, sophomore, etc) and its associated getter/setter. It should also over-rode toString(). Over-load the constructor to take 0, 5, or 6 arguments, each invoking the appropriate super() constructor

  1. Create a Faculty.java child that inherits from person. It should contain a degree attribute that is as a ArrayList and its associated getter/setter. In addition to over-riding toString(), it should also over-ride the displayName() method to returns a string that includes the *first* degree in the ArrayList (e.g. Dr. John Doe, PhD.) Over-load the constructor to take 0, 5, or 6 arguments, each invoking the appropriate super() constructor.

  1. Write a Lab1.java tester that exercises all constructors, accessors, mutators, as well as the toString() and displayName () methods.

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!