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:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Program to check if water tank overflows when n solid balls are dipped in the water tank
- Number of containers that can be filled in the given time
- Count of vessels completely filled after a given time
- Find amount of water wasted after filling the tank
- Check for integer overflow on multiplication
- How to avoid overflow in modular multiplication?
- Reverse digits of an integer with overflow handled
- Compute average of two numbers without overflow
- Kth Smallest Element of a Matrix of given dimensions filled with product of indices
- 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
- Maximize count of empty water bottles from N filled bottles
- Find the element at the specified index of a Spirally Filled Matrix
- Program to find the time after K minutes from given time
- Minimum time to reach a point with +t and -t moves at time t
- Changing One Clock Time to Other Time in Minimum Number of Operations
- Check if it is possible to make x and y zero at same time with given operation
- Check for balanced parentheses in an expression | O(1) space | O(N^2) time complexity
- Check if the given array can be reduced to zeros with the given operation performed given number of times
- Python 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