Question: Java programming help needed Question 41 20 pts Define an interface called Shape that requires methods to get x and y, and a method to

Java programming help needed

Java programming help needed Question 41 20 pts Define an interface called

Question 41 20 pts Define an interface called Shape that requires methods to get x and y, and a method to calculate the area. Call these methods getX(), getYO, and getArea(). Write a class called MyRectangle that implements the Shape interface and contains: . The double data fields X, y, length, and width with get and set methods. A no-arg constructor that creates a default rectangle with 0 for both x and y, and 1 for both the length and width. A constructor that creates a rectangle with the specified X, y, length and width. A method getX() that returns the x location value of the rectangle. A method getY() that returns the y location value of the rectangle. A method getArea() that returns the area of the rectangle. B I U A . A . L E B B B E X' X E - & Vx & GT 12pt Paragraph 0 words Question 42 20 pts Design a class named Person. A person has a name and a phone attribute. Now, design a subclass named Employee (child class of Person). An employee has the inherited attributes plus a salary attribute. Create Staff as a subclass of Employee. A staff has the inherited attributes plus a title attribute. Remember to use the appropriate access types for the attributes. Only write the attributes and constructors. Constructors are required! For time, do not create the behaviors, getters or setters. I will assume that you would have created them given more time. Demonstrate that you can set up the inheritance relationship, including passing the information from the child constructor to the parent constructor. B I U A . A . I E B B B E X' X E . & Vx & GT 12pt Paragraph

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 Programming Questions!