Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that calculates how many gallons of water are in a rectangular swimming pool. Your program should ask the user for the dimensions

image text in transcribed
Write a program that calculates how many gallons of water are in a rectangular swimming pool. Your program should ask the user for the dimensions of the pool, in feet (length, width, depth). Each of these values should be stored in a data variable. The user does not need to enter whole numbers. Next, your program calculates how many gallons of water are in the pool. Do this by first calculating how many cubic inches of water (length height depth, in inches). There are 231 cubic inches in one gallon. Your program should then print out the result. Sample output is provided below (data typed by user is in bold). Note, I have run my program three times to get these three printouts... Please enter the length of the pool (ft): 21 Please enter the width of the pool (t) 12 > Please enter the depth of the pool (Et) 4.5 Your swimming pool contains approximately 8482.91 gallons Please enter the length of the pool (ft): 15 Please enter the width of the pool (t) 15 > Please enter the depth of the pool (ft): 10 Your swimming pool contains approximately 16831.17 gallons Please enter the length of the pool (fc): > Please enter the width of the pool (ft): 3 Please enter the depth of the pool (t) 0.5 Your swimming pool contains approximately 33.66 gallons Your program output should appear exactly as shown above. Pay attention to detail: notice how the user's input is all lined up, and the output is printed to 2 decimal places

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_2

Step: 3

blur-text-image_3

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

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

Explain the calculation of net sales and net purchases.

Answered: 1 week ago