Question: Please write a simple and very basic C + + program to answer this problem: Problem# 2 : Water Tank Filling Rates You have two
Please write a simple and very basic C program to answer this problem:
Problem#: Water Tank Filling Rates
You have two water tanks, Tank A and Tank B Initially, Tank A contains less water than Tank B However,
the filling rate of Tank A is faster than the filling rate of Tank B Write a C program that prompts the user
to enter the current water levels and filling rates for both tanks. The program calculates and outputs after
how many hours Tank A will have more or equal water than Tank B It also prints the final water levels of
both tanks at that time.
InputOutput samples:
Initial water level of Tank A liters:
Filling rate of Tank A liters per hour:
Initial water level of Tank B liters:
Filling rate of Tank B liters per hour:
Error: The initial water level of Tank A must be less than that of Tank B
Initial water level of Tank A liters:
Filling rate of Tank A liters per hour:
Initial water level of Tank B liters:
Filling rate of Tank B liters per hour:
Error: The filling rate of Tank A must be greater than that of Tank B
Initial water level of Tank A liters:
Filling rate of Tank A liters per hour:
Initial water level of Tank B liters:
Filling rate of Tank B liters per hour:
After hours, the water level of Tank A will be greater than or equal to the water
level of Tank B
Water level of Tank A: liters
Water level of Tank B: liters
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
