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:
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- 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 if it is possible to make x and y zero at same time with given operation
- Compute average of two numbers without overflow
- How to avoid overflow in modular multiplication?
- Check for balanced parentheses in an expression | O(1) space | O(N^2) time complexity
- Reverse digits of an integer with overflow handled
- Program to find the time remaining for the day to complete
- Time difference between expected time and given time
- Sum of elements in range L-R where first half and second half is filled with odd and even numbers
- Python program to convert time from 12 hour to 24 hour format
- Program to check if two strings are same or not
- Program to check for ISBN
- Program to convert time from 12 hour to 24 hour format
- Changing One Clock Time to Other Time in Minimum Number of Operations
- Program to check if N is a Icositetragonal number
- Program to check if N is a Icosihenagonal number
- Program to check if N is a Icositrigonal number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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