Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems analysis and design

Authors: kenneth e. kendall, julie e. kendall

8th Edition

135094909, 013608916X, 9780135094907, 978-0136089162

Students also viewed these Algorithms questions

Question

What is removed when a relation is converted from 2NF to 3NF?

Answered: 1 week ago

Question

Define what is meant by RAD.

Answered: 1 week ago