Answered step by step
Verified Expert Solution
Question
1 Approved Answer
INTRODUCTION A municipal water tank has a shape as shown to the right There is a float inside thetank that can transmit the water levels
INTRODUCTION A municipal water tank has a shape as shown to the right There is a float inside thetank that can transmit the water levels to the city office. The height data collected for one week from the float has been placed in an input file called water level. hf The city needs an automated system that will alert city officials when the water level is too low or too high, and when the water level is good. Since the shape of the tank has two distinct parts (a cylinder and an inverted frustum), two volumetric equations are needed. The volume of the cylindrical portion is computed by: Where rcis the radius of the cylinder and h is the height of the float. The total volume of the cylinder plus frustum portion is computed by: NOTE: Define pi as a symbolic and use 3.14159 for accurate computations where h is the height of float, hc is the height of the cylinder, is the radius ofthe cylinder, and the water in the frustum. The radius of the water in the frustum is computed by: is the radius of NOTE: All variables must be appropriate variable names. No single letter variables are allowed in your program 10.5 ASSIGNMENT: Write a Cprogram that will read from the input file the control number (record line 1), the radius and height of the cylinder and the radius and height of the frustum (record line 2), and the float heights (record lines 3-12). The input file is comma delimited. The program will compute the volume of water in cubic meters in the tank, and it will print the float heights and volumes in table format. Additionally, the program will test for the following conditions Ifthe float height is negative meters print the float height and the message: Recalibrate float Ifthe float height is greater than the cylinder height plus the frustum height print the float height and the message: Recalibrate float Ifthe float height is greater than or equal to 0.0 meters, or less than 3.0 meters print the float height and the message: Filling tank Ifthe float height is greater than or equal to 3.0 meters and the float height is less than or equal to the cylinder height, then compute the water volume in the cylinder and print the float height and the computed volume
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started