i've been having a problem trying to do an assignment for school, and i'm not trying to ask anyone to do it for me cuz i know how to put it in code but i'm having a problem finding a formula this is the question
Quote:
a parking garage charges by the following fee schedule:
1.50 for the first thirty minutes
1.25 for each additional halfhour of part thereof for the next 4.5 hours, this will account then for the first 5 hours
1.50 for each additional hour (past the 5 hours) or part thereof to a maximum of 20.00 for the entire stay.
i'm suposed to beable to make the user input how many minutes they stayed and then the program give them the cost. the only equation i got was:
Quote:
(timee - 30) / 30 * 1.25 + basecharge
var basecharge : real := 1.50 %the 1.50 for the first 30 min.
var timee : real %the person puts in the minutes
does this seem rite? or am i doing something wrong?