Given a tank with definite height and radius and the flow of water available to fill the tank. Determine whether the tank will overflow or not in a given amount of time.
Note: The flow of water will be available in volume per minute.
--r=5-- ---------- ^ | | | | | | | | h = 10 | | | ---------- ^ rate_of_flow = 10 Input : given_time = 10.0 Output : Underflow Input : given_time = 100.0 Output : Overflow
Volume of a cylindrical tank is (22/7) * radius * radius * height. First, find out the amount of time required to completely fill the tank then compare it with the given time. If the given time is greater than required time, it will result in an overflow condition. If the given time is less than the required time then it will result in an underflow condition otherwise the tank is filled.
Below is the implementation of above approach:
- Program to check if water tank overflows when n solid balls are dipped in the water tank
- Check for integer overflow on multiplication
- Program to find the time after K minutes from given time
- Find amount of water wasted after filling the tank
- Check for balanced parentheses in an expression | O(1) space | O(N^2) time complexity
- Compute average of two numbers without overflow
- How to avoid overflow in modular multiplication?
- Program to find the time remaining for the day to complete
- Reverse digits of an integer with overflow handled
- Sum of elements in range L-R where first half and second half is filled with odd and even numbers
- Time difference between expected time and given time
- Changing One Clock Time to Other Time in Minimum Number of Operations
- Python program to convert time from 12 hour to 24 hour format
- Minimum time to reach a point with +t and -t moves at time t
- Program to convert time from 12 hour to 24 hour format
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : jit_t