52.2k views
1 vote
Write a program that repeatedly shows the user a menu to select the shape form three main shapes or to print the shapes created so far. If the user selects to create a new shape, the program prompts the user to enter the values for the size of the selected shape (How many of the selected shape user wants to create). The shape is then stored in an array. If the user selects to print the current shapes, print the name and the total area of each shape to the console.

User Kara Woo
by
3.5k points

2 Answers

1 vote

Final answer:

The question involves programming a shape management system where users can add shapes and view a list of current shapes, showing each shape's name and total area.

Step-by-step explanation:

The question involves writing a program that manages shapes with the capability for a user to add new shapes and to print information about the shapes stored. When a user chooses to create a new shape, the program will prompt them for the size and the number of shapes they wish to create, storing this information in an array. Whenever the user elects to view the current shapes, the program will display the name and the total area for each shape in the console.

In a real-world application, you would need to determine how to calculate the area for each kind of shape and devise a menu system that can handle user input and maintain an array of created shapes. The program would likely involve loops for the menu, conditionals for the shape selection, and methods for storing and displaying shape information.

User Ibrokhim Kholmatov
by
3.6k points
7 votes

Answer:

Step-by-step explanation:

The following code is written in Python. It creates a program that keeps printing out a menu allowing the user to create shapes. These shapes are saved in an array called shapes. Once the user decides to exit, it prints all of the shapes in the array along with their total area. The output can be seen in the attached picture below. Due to technical difficulties, I have added the code as a txt file below.

Write a program that repeatedly shows the user a menu to select the shape form three-example-1
User Tim Joyce
by
3.9k points