how do i make it so that an eqation in my program can only have one max anwser?
Quote:
var timee : real
var total : real
var basecharge : real := 1.50
put "Please type in how many minutes you were parked in the garage then press enter."
get timee
if timee <= 30 then
total := basecharge
elsif timee > 30 and timee <= 60 * 5 then
total := (timee - 30) / 30 * 1.25 + basecharge
elsif timee > 60 * 5 then
total := ceil ((timee / 60) - 5 * 1.50) + 1.50 + (5 * 2.1 * 1.50)
end if
put "this is what you should pay ", total : 0 : 2
how do i make it so that the person only has to pay 20.00 max