Question: Write a program that takes in a value for the radius of a circle, and outputs the area and circumference of that circle rounded to

 Write a program that takes in a value for the radiusof a circle, and outputs the area and circumference of that circle

Write a program that takes in a value for the radius of a circle, and outputs the area and circumference of that circle rounded to two decimal places (the rounding has been done for you). Hint: The equation for the area of a circle is A = (pi) (radius)^2 Hint: The equation for the circumference of a circle is C = 2(pi) (radius) Ex) Input: 5.0 Output: The area of this circle is: 78.50 The circumference of this circle is: 31.40 287956.1731522 LAB ACTIVITY 13.4.1: Circle Math 0/4 LabProgram.java Load default template... 1 import java.util.Scanner; 3 public class LabProgram { public static void main(String[] args) { 5 double pi - 3.14; 6 double radius; 7 double area; double circumference; 8 9 // get the radius from user Scanner scnr = new Scanner(System.in); radius scnr.nextDouble(); 1 2 3 -4 5 6 //your code goes here // print the results. System.out.println("The area of this circle is: " + String.format("%.2f", area)); System.out.println("The circumference of this circle is: " String.format("%.2f", circumference)); + .8 9 0 01 } }

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!