Question: Need book solution for the following- Scenario: Write a console program that uses a Circle class to calculate a circles area, diameter and circumference given

Need book solution for the following-

Scenario:

Write a console program that uses a Circle class to calculate a circles area, diameter and circumference given the circles radius.

Fields (Property):

The circles Radius: a double, read and write

Constant:

PI: Constant value of 3.14159

Methods:

-Constructor: Accepts the radious of the circle class as an argument.

-Constructor: A no argument constructor that sets the radius to 0.

-GerArea: Returns the area of the circle, which is calculated as: Area = PI * radius * radius

-GetDiameter: Returns the circumference of the circle, which is calculated as: Circumference = 2 * PI * radius

Write a program that demonstrates the Circle class by asking the user for the circles radius, creating a circle object, and then reporting the circles area, diameter and circumference.

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