Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DATA FILE INTRODUCTION A municipal water tank has a shape as shown to the right. There is a float inside the tank that can transmit

image text in transcribed

image text in transcribed

DATA FILE

image text in transcribed

INTRODUCTION A municipal water tank has a shape as shown to the right. There is a float inside the tank 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 tank he 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 water volume of the cylindrical portion is computed by: Where rsis the radius of the cylinder and h-b is the height of the float when the float is at the top of the cylnder. The total volume of the cylinder plus frustum is computed by: where h is the height of float, k is the height of the cylinder, gsis the radius ofthe cylinder, and gx is the radius of the water in the frustum. The radius of the water in the frustum is computed by: 10.5 ASSIGNMENT: Write a C program that will read from the comma delimited input file the cylinder radius and height, and the frustum radius and height in that order. Using a while loop, the program will read the float heights, test for float heights, compute the volume of water in cubic meters in the tank, and it will print the float heights and volumes in table format. The float height test conditions are If the float height is negative, print the message The height cannot be negative, else if the float height equals zero, print the message Tank is empty currently filling, else if the float height is greater than the cylinder height plus the frustum height, print the message The height cannot exceed tank height, else if the float height is less than or equal to the cylinder height then compute and print the water volume in the cylinder, else compute and print the water volume in the tank. The results will be printed to the computer screen and to an output data file called tank report The format for the output is given below. Use your PC's cursor to determine the horizontal and vertical spacing for the output. OUTPUT FORMAT: MUNICIPAL WATER SUPPLY Tank dimensions: Cylinder radius .x meters cylinder height 'x meters Frustum radius -.x meters Frustum height = x meters m RESULTS Float Height Water volume (cubic meters) (meters) Print message FILE PATHS: Before submitting your program to Blackboard, you must set the following file paths in your program: "u:lengr 200Vtank.txt" "u:lengr 2001tank_report.txt" 12.5,19.0,23.0,14.0 10.0 5.5 1.0 8.0 16.0 0.0 33.0 25.7 36.5 32.5 999.0

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

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions

Question

What advice would you provide to Jennifer?

Answered: 1 week ago

Question

What are the issues of concern for each of the affected parties?

Answered: 1 week ago