Create a class named testcircle whose main method declares


Create a class named Circle with field names radius, diameter, and area. Include a constructor that sets the radius to 1 and calculates the other two values. Include methods named setRadius() and getRadius(). The setRadius() method not only sets the radius, but calculates the other two values (as you know, the diameter of a circle is twice the radius, the area of a circle is pi multiplied by the square of the radius). Save class as Circle.java.

Create a class named TestCircle whose main method() declares several Circle objects. Using setRadius() method, assign one circle a small radius value (code a user input making use of Scanner of JOptionPane), and assign another a larger radius value (to be an input by a user as well). Do not assign a value to the radius of the third circle; instead retain the value assigned at object construction. Display all the values for three Circle objects. Save the class as TestCircle.java.

Note: Create an UML class diagram prior to coding the application.

Compile, run, and check the results. Submit the following:

1. The source file (If more than one file has been created, zip them into one .zip file for posting.)

2. An MS .doc file with explanations/comments of your solution and the results of a test run, including a screen shot picture

3. The UML class diagram of the application should be included in the deliverable as a part of the MS .doc above, or as a separate file

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Create a class named testcircle whose main method declares
Reference No:- TGS01235058

Now Priced at $50 (50% Discount)

Recommended (96%)

Rated (4.8/5)

A

Anonymous user

2/12/2016 2:34:49 AM

I am very happy with the work, their tutors provided me. It really helps me to gain my academic confidence. Do keep the good work. I will definitely suggest my friends for use of their assistance.