Question: Create a Java program that displays a menu with shape options. Using a while loop prompt the user to choose a shape from a to

Create a Java program that displays a menu with shape options. Using a while loop prompt the user to choose a shape from a to c; however, if the user enters a wrong choice then keep prompting. Thereafter, using an if-elseif structure draw the shape using asterisks (*) based on the user's choice.

These are the drawing outputs after a user makes a choice:

a) Square

****

* *

* *

****

b) Triangle

*

***

*****

c) Rectangle

*****

* *

*****

Example:

a. Square

b. Triangle

c. Rectangle

Please enter your choice (a to c): e

a. Square

b. Triangle

c. Rectangle

Please enter your choice (a to c): b

*

***

*****Create a Java program that displays a menu with shape options. Using

140 points Create a Java program that displays a menu with shape options. Using a while loop prompt the user to choose a shape from a to c; however, if the user enters a wrong choice then keep prompting. Thereafter, using an if-elseif structure draw the shape using asterisks (*) based on the user's choice. Name your file: "DrawShapes.java". These are the drawing outputs after a user makes a choice: a) Square **** b) Triangle c) Rectangle ****** Example: a. Square b. Triangle c. Rectangle Please enter your choice (a to c ): e a. Square b. Triangle c. Rectangle Please enter your choice ( a to c ): b

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!