Converting each of them in rupees . As we are given totalRupees = 1800
$ one = $ X * 1 ; $ fifty = ( ( $ Y * 1 ) / 2.0 ) ; $ twentyfive = ( ( $ Z * 1 ) / 4.0 ) ; $ total = $ one + $ fifty + $ twentyfive ; $ result = ( ( $ totalRupees ) / $ total ) ; return $ result ; }