108k views
14 votes
You can calculate the surface area of a cube if you know the length of an edge. Write a program that takes the length of an edge (an integer) as input and prints the cube's surface area as output. Enter the cube's edge:4. The surface area is 96 square units.

2 Answers

5 votes

Answer:

edge=float(input("Enter the cube's edge: "))

area=6*edge**2

print("The surface area is: "+str(area), "square units.")

Step-by-step explanation:

request input

computer income tax

then display information

User Holloway
by
8.7k points
6 votes

Answer:

Program in Python:

edge = float(input("Edge Length: "))

area = 6 * edge**2

print("Surface Area: "+str(area))

Step-by-step explanation:

This line prompts the user for the length of the edge

edge = float(input("Edge Length: "))

This calculates the surface area using
Area = 6a^2

area = 6 * edge**2

This prints the calculated surface area

print("Surface Area: "+str(area))

This solution was implemented in Python

User Gesner
by
8.5k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.