Question #278700

Ahmed wants to gift his friend. He has 82.300 OMR. He wants the following products: Sport suite with 15.700 OMR Sport shoes with 32.00 OMR Sport water bottle with 4.50 OMR Headphone with 8.25 OMR iPod with 9.88 OMR Write an algorithm to check whether he can buy all the above items. Display the total, and the remaining amount in OMR that Ahmed will have if any.


Expert's answer

input:

m \\ Ahmed has amount

t = 82.3+17.5+32+4.5+8.25+9.88 \\ calculate total amount

r = m-t \\ calculate remaining amount

if r < 0 then

display "not enough money"

output:

r, t


LATEST TUTORIALS
APPROVED BY CLIENTS