112k views
3 votes
Draw the flowchart and pseudocode for a program allowing the user to enter a value for one edge of a cube(A box-shaped solid object that has six identical square faces).

The program should calculate the surface area of one side of the cube
The program should calculate the surface area of the whole cube
The program should calculate the volume of the cube.
The program should output all of the results from the calculations.
The program should output the value the user entered.
Submit the flowchart and pseudocode together with draw.io
Complete the flowchart and pseudocode using draw.io. Include your pseudocode by adding a "square shape" next to your flowchart and populating it with your pseudocode for the program. Export your work in PDF format and upload it to the Blackboard assignment area by clicking on the Browse My Computer button below the text editor.
Complete the Python code using IDLE. Upload your .py file to the Blackboard assignment area by clicking on the Browse My Computer button below the text editor.

1 Answer

4 votes

Answer:

The flowchart, pseudocode and python program all have the same objective.

The flowchart is designed using draw.io (See attachment)

Pseudocode begins here:

1. Start

2. Input Length

3. Area1 = Length * Length

4. Area2 = 6 * Area1

5. Volume = Area1 * Length

6. Print Length

7. Print Area1

8. Print Area2

9. Print Volume

10. Stop

Python Program begins here:

#Prompt user for input

length = float(input("Length of the edge: "))

#Calculate the area of a side

Area1 = length * length

#Calculate the area of the cube

Area2 = 6 * Area1

#Calculate the volume

Volume = Area1 * length

print("Length: "+str(length))

print("Area of a side: "+str(Area1))

print("Area of the cube: "+str(Area2))

print("Volume: "+str(Volume))

Step-by-step explanation:

The flowchart , pseudocode and python program start by requesting for user input;

This user input is saved in variable length

The surface area of a face is calculated by length * length and saved in Area1; i.e. Area1 = length * length

The surface area of the cube is calculated by 6 * Area1 and saved in Area2. i.e. Area2 = 6 * Area1 = 6 * length * length

The volume of the cube is calculated by Area1 * length and saved in volume. i.e. Volume = Area1 * length = length * length * length

After the surface area of one side of the cube

, the surface area of the whole cube and the volume of the cube are calculated; the program then prints the user input (length) and each of the calculated parameters.

Draw the flowchart and pseudocode for a program allowing the user to enter a value-example-1
User Dhofstet
by
6.0k points