Question: IN JAVA PLZ You must use the concept of class and objects we learned in the class to complete this program. Write a Circle class

IN JAVA PLZ You must use the concept of class and objects we learned in the class to complete this program. Write a Circle class that has the following fields:
radius: a double
PI: a double initialized with the value 3.14159
The class must have the following methods:
CONSTRUCTOR. This constructor accepts the radius of the circle as an argument.
CONSTRUCTOR. This second constructor, a no-arg constructor that sets the radius field to 0.0.
setRadius. A mutator method for the radius field.
getRadius. An accessor method for the radius field.
area. Returns the area of the circle, which is calculated as
area = PI * radius * radius
diameter. Returns the diameter of the circle, which is calculated as
diameter = radius *2
circumference. Returns the circumference of the circle, which is calculated as
circumference =2* PI * radius
You may not use all these methods mentioned above when executing the program. However, you still need to have the above list implemented for future use.
Write a program that demonstrates the Circle class by asking the user for a pizzas radius in a dialog box. Then ask the user to enter the radius of a steering-wheel as shown in the screenshots below. Once you have these two inputs, create two Circle objects for the pizza and the steering-wheel. Finally, display each of these objects' area, diameter, and circumference in a dialog box as shown in the screenshot. (Note, if you want to round a number in a dialog box, you can use: String.format("%,.2f",3.24866) This will give the result 3.25)
IN JAVA
 IN JAVA PLZ You must use the concept of class and

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!