Question: (Depicted from Exercise 3, Attaway textbook, Chapter 4, page 138) Write a script to calculate the volume of a pyramid, which is 1/3 * length

 (Depicted from Exercise 3, Attaway textbook, Chapter 4, page 138) Write

(Depicted from Exercise 3, Attaway textbook, Chapter 4, page 138) Write a script to calculate the volume of a pyramid, which is 1/3 * length * width height. Prompt the user to enter values for the length, width, and height, and then calculate the volume of the pyramid. When the user enters each value, he or she will then also be prompted for either 'i' for inches or'c for centimeters. (Note that 2.54 cm 4 1 inch.) The script should print the volume in cubic inches with three decimal places. As an example, the output format will be: This program will calculate the volume of a pyramid. Enter the length of the base: 50 Is that i or c? '' Enter the width of the base: 6 Is that i or c?'c Enter the height: 4 Is that i or c? The volume of the pyramid is xxx.xxx cubic inches

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!