Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(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

image text in transcribed
(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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions