Question: This is the code given with it, Code is being done on Java Using eclipse Question 1: Organize the following set into inheritance hierarchies of

This is the code given with it, Code is being done on Java Using eclipse


Question 1: Organize the following set into inheritance hierarchies of classes. Draw the hierarchy. You may add additional classes to act as superclasses, if necessary. [Hint: use the isa rule] Question 2: An organization has three categories of employees: professional staff, technical staff, and support staff. The organization also has departments and divisions. Each employee belongs to either a department or a division. Draw a class diagram that captures the above scenario. Think about and include important attributes to the classes. Question 3: [Programming] Design a class named Rectangle that extends Geometricobject. The class contains: - Two double data fields named width, and length with default values 1.0 to denote two sides of the rectangle. - A constructor that creates a rectangle with the specified width, and length. - The get and set methods for all two data fields. - A method named getarea() that returns the area of this rectangle. - A method named getperimeter() that returns the perimeter of this rectangle. - A method named tostring() that returns a string description for the rectangle, as follows return "Rectangle: Width = " + width + " length = " + length; - Your code must be fully documented. This includes using Javadoc comments. - Use the following code as a startup for your solution. You only need to implement the Rectangle class. public class Assignment1 \{ public static void main(String[] args) \{ Rectangle rectangle = new Rectangle (1,1.5); rectangle.setColor ("yellow"); rectangle.setFilled(true); System.out.println(rectangle); System.out.println ("The area is " + rectangle.getArea()); System. out.println("The perimeter is " + rectangle.getPerimeter ()); System.out.println(rectangle); \} 3 public abstract class Geometricobject \{ private String color = "white"; private boolean filled; private java.util. Date dateCreated; / Construct a default geometric object */ protected Geometricobject() i dateCreated = new java.util. Date (); \} /** Construct a geometric object with color and filled value */ protected Geometricobject(String color, boolean filled) \{ dateCreated = new java.util. Date (); this.color = color; this.filled = filled; \}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
