+ Circle.java TestCircle.java Instructions 1 class Circle private double radius Create a class named Circle with fields named radius, diameter private double area; private double diameter; Circle) and...

+ Circle.java TestCircle.java Instructions 1 class Circle private double radius Create a class named Circle with fields named radius, diameter private double area; private double diameter; Circle) and area . Include a constructor that sets the radius to 1 and 4 calculates the other two values. Also include methods named 5 stratus () and get Radius (). The set Radius (method not only sets the radius, but it also calculates the other two values. (The} 6 public void set Radius (double r) 7 diameter of a circle is twice the radius, and the area of a circle is pi 8 public double get Radius ({multiplied by the square of the radius. Use the Math class PI 10 constant for this calculation.) Private void compute Diameter () 11 12 Grading private voted compute Area () 13 14 Write your Java code in the area on the right. Use the Run button to public double get Diameter () 15 compile and run the code. clicking the Run Checks button will run pre-} public double get Area) 16 configured tests against your code to calculate a grade. 17} 18 Once you are happy with your results, click the Submit button to record your score. 19) 20 Circle.java TestCircle.java Instructions Elsa’s Test Circle {public static void main (String args []) {Circle a new Circle) Create a class named circle with fields named radius, diameter and area. Include a constructor that sets the radius to 1 and Circle b new Circle (); calculates the other two values. Also include methods named Circle c new Circle (); 5 set Radius) and get Radius). The set Radius () method not only sets the radius, but it also calculates the other two values. (The diameter of a circle is twice the radius, and the area of a circle is pi multiplied by the square of the radius. Use the Math class PI 6 set Radius (1. 5); set Radius (1500 .50); 7 8 System. Out. Printing (“The area of a is “+ 10 constant for this calculation.) a-get Area)) System.out.println (“The diameter of a tes” + a.getDiameter ()); 11 12 Grading 13 14 System.out.println ("The area of b is Write your Java code in the area on the right. Use the Run button to b.getArea)); 15 compile and run the code. Clicking the Run Checks button will run pre- System.out.println (“The diameter of b is “16 configured tests against your code to calculate a grade. 17 b. getDianeter ()); System.out.println (“The area of c is "+ 18 Once you are happy with your results, click the Submit button to record your score. c.getArea)); System.out.println (“The diameter of c is” + 19 20 21 c.getDianeter ()) 22 23 24 25 26
May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here