Originally Posted by
jbc223456
If it is by the hour, then you only need minutes in order for display purposes, so you can leave that out of the calculation. You will want to use several if statements to calculate the amount charged. Think about how you would structure that portion (hours <= 5? If so, totalcost = $5, etc for 6-24, and then for 24+). You have to keep in mind that you want to charge $0.50 more per hour if the time exceeds 24 hours. Therefore, you will need a loop. The way you have it now, you will only charge a total of $12.50, even if something was rented for 10 years!