Question: Implement the Circle and Rectangle classes: Implement the Circle and the Rectangle classes in the folder P1 using the instructions below. You are NOT allowed

Implement the Circle and Rectangle classes: Implement the Circle and the Rectangle classes in the folder P1 using the instructions below. You are NOT allowed to create any other classes, additional instance variables, or make any changes to classes other than Circle and Rectangle. You will lose points if you do. For the Circle class, implement the following: A private double instance variable m_radius. A constructor that takes two parameters (in the order of color, radius). It should use the parameter for radius to set the m_radius instance variable and then explicitly call the parent class constructor using the super keyword and pass in the color parameter. A method that overrides the calcArea method of the superclass and calculates the area of the circle. The area of a circle can be calculated as 3.14  ^2 (where is the radius). A method that overrides the calcPerimeter method of the superclass and calculates the perimeter of the circle. The perimeter of a circle can be calculated as 2  3.14  (where r is the radius). For the Rectangle class, create the following: Two private double instance variables m_width and m_length. A constructor that takes three parameters ?

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