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
*
***
*****
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
Get step-by-step solutions from verified subject matter experts
