Question: Write a test program called TestCircle YourName that Prompts the user to enter the radius of a circle, a color and a boolean value to

Write a test program called TestCircleYourName that

Prompts the user to enter the radius of a circle, a color and a boolean value to indicate whether the circle is filled. Read these values and store them in appropriate variables.

The program should create a Circle object with the given radius and set the color and filled properties using the inputs obtained in the step above.

The program should display the area, perimeter, color using the toString() method that should print the values of radius, area and perimeter of the circle.

Reset the color, filled and radius using the setters and then print the new values of color and . Use the toString() method to print the new radius, area and perimeter. You can choose values for color , filled and radius in your setters.

Create a new circle object using the default constructor.

Prompt the user for values of radius, color and filled, and read them one by one and use these values to set the instance variables using setter.

Apply the toString() method to the new circle object whose values were set using the setters in the step above.

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!