Answered step by step
Verified Expert Solution
Question
1 Approved Answer
GRADED ACTIVITY #5 (M7.2): DECISION CONTROL STRUCTURE (SWITCH) PROBLEM Instruction: The areas of the following figures are computed as follows: 1. trapezoid: (h/2) (b1+2) 2.
GRADED ACTIVITY #5 (M7.2): DECISION CONTROL STRUCTURE (SWITCH) PROBLEM Instruction: The areas of the following figures are computed as follows: 1. trapezoid: (h/2) (b1+2) 2. ellipse: TT (r1+r2) 3. equilateral triangle: 3(a) 4 Using switch for the choices, write a Java program that will display a menu and the user can choose which figure to compute. When the user decides whether 1. Trapezoid, 2. 82 Ellipse, or 3. Equilateral Triangle, compute the area of the figure chosen and output the results. Depicted below are sample outputs when the program is executed (the items in bold characters are inputted by the user, while the items in bold italic characters are calculated and outputted by the program): Menu: Compute Area of 1. Trapezoid 2. Ellipse 3. Equilateral Triangle Choice: 1 Trapezoid Enter h: 3 Enter bl: 2 Enter b2: 2 Area of Trapezoid is 6 Menu: Compute Area of 1. Trapezoid 2. Ellipse 3. Equilateral Triangle Choice: 2 Ellipse Enter rl: 2 Enter r2: 3 Area of Ellipse is 18.85 Menu: Compute Area of 1. Trapezoid 2. Ellipse 3. Equilateral Triangle Choice: 3 Equilateral Triangle Enter a: 3 Area of Equilateral Triangle is 3.9
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started