Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that will calculate the volume of a rectangular prism and calculate gallons needed to fill it, in all units of measurement

Write a C++ program that will calculate the volume of a rectangular prism and calculate gallons needed to fill it, in all units of measurement (UOM).

Requirements:

Get input from the user

Get the unit of measurement (cm vs. in vs. ft)

Validate the UOM(unit of measurement); restart if invalid

Get measurements (length, width, height)

Validate measurements (i.e., make sure theyre numbers); restart if invalid

Compute the volume using l*w*h

Display the results

Display the volume, including the chosen UOM

Convert the volume to one of the unchosen UOMs

Display the volume, including the first unchosen UOM

Convert the volume to the second unchosen UOM

Display the volume, including the second unchosen UOM

Volume Conversions:

1 cm = 0.393701 in = 0.0328084 ft

1 in = 2.54 cm = 0.0833333 ft

1 ft = 30.48 cm = 12 in

CubicCentimeters

length(inches) width(inches) height(inches) 16.387064 = centimeters(cm)

length(feet) width(feet) height(feet) 28316.846592 = centimeters(cm)

length(cm) width(cm) height(cm) = cubic centimeters(cm)

CubicFeet

length(feet) width(feet) height(feet) = cubic feet(cf)

length(inches) width(inches) height(inches) 1728 = cubic feet(cf)

length(cm) width(cm) height(cm) 28316.846592 = cubic feet(cf)

CubicInches

length(inches) width(inches) height(inches) = cubic inches(in)

length(feet) width(feet) height(feet) 1728 = cubic inches(in)

length(cm) width(cm) height(cm) 16.387064 = cubic inches(in)

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions