215k views
5 votes
Write a program to calculate the volume of a cube which contains 27 number of small identical cubes on the basis of the length of small cube input by a user.​

1 Answer

2 votes

Answer:

This program is written in python programming language.

The program is self explanatory; hence, no comments was used; However, see explanation section for line by line explanation.

Program starts here

length = float(input("Length of small cube: "))

volume = 27 * length**3

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

Step-by-step explanation:

The first line of the program prompts the user for the length of the small cube;

length = float(input("Length of small cube: "))

The volume of the 27 identical cubes is calculated on the next line;

volume = 27 * length**3

Lastly, the calculated volume of the 27 cubes is printed

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

User Kusut
by
5.9k points