Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Write a Java program that will display the following menu until the exit choice (#4) is selected by the user ( See Sample Program Run below ).

Write a Java program that will display the following menu until the exit choice (#4) is selected by the user (See Sample Program Run below). The program will calculate the areas and perimeter or circumference by calling only two functions and passing two parameters: a numeric value (side), and a character code to each function.

Program Requirements:

1.The character code, ‘C’ or ‘S’, is used to distinguish between circle and square shapes.

2.  calcArea() will accepttwo parametersand return the area of the shape (either the circle or the square depending on the character code received).

3.calcPerim()will accepttwo parametersand return the perimeter or circumference of the shape (either the circle or the square depending on the character code received).

4.Themain()functionwill display a message which identifies the selected shape and its area or perimeter/circumference, depending upon the selected option.

5.PIshould be declared as a constant.

--------------------------------------------------------------------------------------------------------------------------Sample Program Run: (USER INPUT appears in BOLD and RED.)

Geometric Calculator

Choose one of the following options:

Press 1 to enter the side or radius and shape code.

Press 2 to display the area.

Press 3 to display the perimeter or circumference.

Press 4 to exit.

Enter selection:  1

Please enter a value for radius or side:10.0

Please enter the shape code (c/C for circle, s/S for square): s

Press 1 to enter the side or radius and shape code.

Press 2 to display the area.

Press 3 to display the perimeter or circumference.

Press 4 to exit.

Enter selection:  2

The area of a square with a side of 10 is: 100.00

Press 1 to enter the side or radius and shape code.

Press 2 to display the area.

Press 3 to display the perimeter or circumference.

Press 4 to exit.

... (More testing must be included here)

Enter selection:  4

Thank you for using the geometric calculator. Bye!

/** To change this license header, choose License Headers in Project Properties.* To change this template file, choose Tools | Templates* and open the template in the editor.*//**** @author...
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question