Question: JAVA PROGRAMMING: (6 points) Write a program that inputs from the user the radius of a circle as an integer and prints the circle's diameter,

JAVA PROGRAMMING:

JAVA PROGRAMMING: (6 points) Write a program that inputs from the user

(6 points) Write a program that inputs from the user the radius of a circle as an integer and prints the circle's diameter, circumference and area using the floating-point value 3.14159 for 7. [Note: You may use the predefined constant Math.PI for the value of t. This constant is more precise than the value 3.14159. Class Math is defined in package java.lang. Classes in that package are imported automatically, so you do not need to import class Math to use it.] Use the following formulas (r is the radius): Diameter = 2*r Circumference = 2 * pi *r Area = pi *r*r Do not store the results of each calculation in a variable. Rather, specify each calculation as the value that will be output in a System.gut.printf statement. The values produced by the circumference and area calculations are floating-point numbers. Such values can be output with the format specifier %f in a System.out.printf statement. Enter radius: 12 Diameter is 24 Circumference is 75.398224 Area is 452.389342

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!