{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Problem 1

# Problem 1 - point in continuing on if it is not correct...

This preview shows page 1. Sign up to view the full content.

ECOR1606 – Problem Solving and Computers Page 1 of 1 Department of Systems and Computer Engineering Carleton University H OT W ATER ! Background information During cold Ottawa winters it is nice to step into a hot shower in the mornings; however, overnight the water in the pipes become cold and it takes some time for that water to flow out before water from the hot water tank comes out. Given the diameter and length of the hot water pipe, along with rate of flow, one can determine what this time is (i.e. determine the volume of water in the pipe and determining how long it takes for it to flow out). To simplify matters further assume that there is 1mL/cm 3 , which is a good approximation. L d Implementation Step #1 Determine a methodology on paper on how to solve this problem. Be sure you take into account the units (pipe diameter specified in cm, pipe length in m, rate of flow in liters/min, and time until hot water starts in s). Write the methodology and equations on paper and try it out with a calculator to confirm its correctness (no
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: point in continuing on if it is not correct!). Step #2 Write a program that will prompt the user to enter the pipe diameter (cm), the pipe length (m), and the rate of flow (liters/min). The program should then output the number of seconds it takes before hot water starts to come out. The program will loop to the beginning re-prompting the user to enter the pipe diameter and will stop if the pipe diameter entered is negative. Sample output Enter the pipe diameter (cm; enter negative number to quit): 1.27 Enter the pipe length (m): 10.668 Enter the rate of flow (liters/min): 11.35623 It will take 7.13999 seconds before hot water beings Enter the pipe diameter (cm; enter negative number to quit): 2.27 Enter the pipe length (m): 10.668 Enter the rate of flow (liters/min): 11.35623 It will take 22.8109 seconds before hot water beings Enter the pipe diameter (cm; enter negative number to quit): -1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online