Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo

1st Edition

0763733148, 978-0763733148

More Books

Students also viewed these Databases questions

Question

What is the playhead?

Answered: 1 week ago

Question

read in a critically evaluative way;

Answered: 1 week ago