Find amount of water wasted after filling the tank | Java program to find the volume of water wasted ; Function to calculate amount of wasted water ; filled amount of water in one minute ; total time taken to fill the tank because of leakage ; wasted amount of water ; Driver code
class GFG { static double wastedWater ( double V , double M , double N ) { double wasted_amt , amt_per_min , time_to_fill ; amt_per_min = M - N ; time_to_fill = V / amt_per_min ; wasted_amt = N * time_to_fill ; return wasted_amt ; } public static void main ( String [ ] args ) { double V , M , N ; V = 700 ; M = 10 ; N = 3 ; System . out . println ( wastedWater ( V , M , N ) ) ; V = 1000 ; M = 100 ; N = 50 ; System . out . println ( wastedWater ( V , M , N ) ) ; } }