posted 17 years ago
Hi!
A parking charge is 2 dollor for up to three houres. After 3 houres the charge increase with 0.5$ every houre.
if a person parks his car 5.3 houres.
He must pay 2$ for first 3 houres and 1.5 dollor for every houre 2+1.5=3.5$
because for 2 hourse we pay 1$ and for 0,3 houre we should pay 0.5 dollor more.
the above codes result is:
2+(0.5*(5.3-3))=3.15$
but it must be 3.5$
because for 2 houres 1$ and for 0.3 houre 0.5$ dollor more.