Question

In: Computer Science

use java The area of a circle is computed by ?? 2 , where r is...

use java

The area of a circle is computed by ?? 2 , where r is the radius of the circle and π is 3.14. The area of a rectangle is computed by ??, where a and b correspond to the length and width of the rectangle respectively. The area of a triangle is computed by ah 2 , where a and h correspond to the length and height of the triangle respectively. Write a Java program: First it asks which one of these three shape’s area needs to be calculated. After the user chooses a shape, it asks for the corresponding parameters, and then displays the computed area.

Solutions

Expert Solution

As you mentioned I have designed the program which meets your requirements.

outputs:


Related Solutions

A circle of radius r has area A = πr2. If a random circle has a...
A circle of radius r has area A = πr2. If a random circle has a radius that is uniformly distributed on the interval (0, 1), what are the mean and variance of the area of the circle? Change the distribution of the radius to an exponential distribution with paramter β = 2. Also find the probability that the area of the circle exceeds 3, if it is known that the area exceeds 2.
1) A circle of radius r has area A = π r2. If a random circle...
1) A circle of radius r has area A = π r2. If a random circle has a radius that is evenly distributed in the interval (0, 1), what are the mean and variance of the area of ​​the circle? choose the correct answer A) 1/3 and 1/12 B) Pi/3 and 1/12 C) Pi/3 and 1/5 D) Pi/3 and (4/45)*Pi^2
Area of Circle
Luther has a circular garden of radius 1.6 cm . If she plans to put artificial grass on it, How much area does she need to cover?
Write a java program that contains 3 overloaded static methods for calculating area of a circle,...
Write a java program that contains 3 overloaded static methods for calculating area of a circle, area of a cylinder and volume of a cylinder. Also create an output method which uses JOptionPaneto display instance field(s) and the result of the computing. Then code a driver class which will run and test calling each of these overloaded methods with hard-coded data and display the data and the result of the calculation by calling output method. Thanks!!
in Matlab, Use the Monte Carlo analysis to compute the area of a circle with radius...
in Matlab, Use the Monte Carlo analysis to compute the area of a circle with radius 1. print out your code, at least one figure on which the circle and ‘dart hits’ are shown, and numerical results for N=10, 100,1000. For each N, repeat the calculation at least 5times.
1) Inside the graph of r = 1 + cos 3Ό 2) Inside the circle r...
1) Inside the graph of r = 1 + cos 3Ό 2) Inside the circle r = -6 cos Ό and outside the circle r = 3
Use the formulas for arc length and surface area and the equation x^2+y^2=R^2 (a)... to derive...
Use the formulas for arc length and surface area and the equation x^2+y^2=R^2 (a)... to derive the formula for the surface area of a sphere with radius R (b)... to derive the formula for the circumference of a circle with radius R
JAVA program: Calculate geometric area for 3 shapes(square, rectangle and circle). You need to build a...
JAVA program: Calculate geometric area for 3 shapes(square, rectangle and circle). You need to build a menu that allows users to enter options. Possible options are 'S' for square, 'R' for rectangle and 'C' for circle. HINT: you can use switch statement to switch on string input Invalid input should throw a message for the user. Example: Invalid input, please try again Each options should ask users for relevant data. HINT: use scanner object to take in length for square,...
a- If the radius r of a circle is measured to be r  0.325 +\-...
a- If the radius r of a circle is measured to be r  0.325 +\- 0.001 m, then calculate the area of the circle A =  3.14r 2 , as well as the uncertainty in the area. b-Explain the difference between precision and accuracy. c-Do systematic errors affect precision or accuracy? Do random errors affect precision or accuracy?
/* calculating area of a circle, calculating area of a rectangle, calculating area of a triangle,...
/* calculating area of a circle, calculating area of a rectangle, calculating area of a triangle, and quit. */ import java.util.Scanner; public class GeoCalculator {    public static void main(String arg[]) { int geoCalc; //number selection of user Scanner get = new Scanner(System.in); //display section. System.out.println("Geometry Calculator"); System.out.println("Please select from the following menu:"); System.out.println("1. Calculate the Area of a Cirlce."); System.out.println("2. Calculate the Area of a Rectangle."); System.out.println("3. Calculate the Area of a Triangle."); System.out.println("4. QUIT"); System.out.println("Please make a selection:...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT