Program to check if tank will overflow , underflow or filled in given time | function to calculate the volume of tank ; function to print overflow / filled / underflow accordingly ; radius of the tank ; height of the tank ; rate of flow of water ; time given ; calculate the required time ; printing the result
< ? php function volume ( $ radius , $ height ) { return ( ( 22 / 7 ) * $ radius * $ radius * $ height ) ; } function check_and_print ( $ required_time , $ given_time ) { if ( $ required_time < $ given_time ) echo ( " Overflow " ) ; else if ( $ required_time > $ given_time ) echo ( " Underflow " ) ; else echo ( " Filled " ) ; } $ radius = 5 ; $ height = 10 ; $ rate_of_flow = 10 ; $ given_time = 70.0 ; $ required_time = volume ( $ radius , $ height ) / $ rate_of_flow ; check_and_print ( $ required_time , $ given_time ) ; ? >