Question
For this part you will design five classes: Person, Student, Employee, Faculty and Staff. A Person class has two subclasses: Student and Employee. The Employee
For this part you will design five classes: Person, Student, Employee, Faculty and Staff. A Person class has two subclasses: Student and Employee. The Employee class has two subclasses, Faculty and Staff. A Person has a name, address, phone number and email address. A student as a class-status (freshman, sophomore, junior or senior). An Employee has an office, salary and date hired. A faculty member has office hours and rank. A staff member has a title. All these attributes are Strings, except salary which is a double. Override the toString() method in each class to return a string containing the class name and the person's name.
1. Create a UML class diagram that illustrates the design.
2. Implement each class using the class diagram as a blueprint: Person.java, Student.java, etc.
Create a test program called Unit06_Prog1.java that creates an instance of each of the classes above, sets the data and calls their toString() method and prints out the result to standard out. Here is a sample run:
part 2:
For this part you will design two classes and an interface; the GeometricObject class, the Square class and the Colorable interface. GeometricObject has the attributes of color (String), filled (Boolean) and creationDate (String). The Colorable inteface defines one method: howToColor() which returns a String and takes no arguments. The Square class has the attribute side (a double) which is the length of its side. It also has the methods getArea() and getPerimeter() which return doubles. All classes have thier getters and setters. The Square class extends the GeometricObject class and implements the Colorable interface. The implementation of the howToColor() method returns the String color all four sides.
1. Create a UML class diagram that illustrates the design.
2. Implement each class and interface in the UML diagram using your UML diagram as a blueprint: GeometricObject.java, Colorable.java and Square.java
3. Create a test program called Unit06_Prog2.java that creates an instance of the Square class and calls it's howToColor() method, printing out the String on standard out.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started