50 likes | 186 Views
START. A. D ISPLAY “Minute vehicle left lot (0 - 59)?”. getVehicle ( vType ). D ISPLAY "Hour vehicle entered lot (0 - 23)?”. getNum (0, 59, m Out ). phOut = hOut pmOut = mOut. getNum (0, 23, hIn ). D ISPLAY “Minute vehicle entered lot (0 - 59)?”. mOut = mOut + 60
E N D
START A DISPLAY “Minute vehicle left lot (0 - 59)?” getVehicle(vType) DISPLAY "Hour vehicle entered lot (0 - 23)?” getNum(0, 59, mOut) phOut = hOut pmOut = mOut getNum(0, 23, hIn) DISPLAY “Minute vehicle entered lot (0 - 59)?” mOut = mOut + 60 hOut = hOut - 1 mOut < mIn TRUE FALSE getNum(0, 59, mIn) DISPLAY "Hour vehicle left lot (0 - 23)?” hDur = hOut - hIn mDur = mOut - mIn chargable = hDur getNum(0, 23, hOut) B A
B mDur != 0 chargable = chargable + 1 TRUE FALSE chargable < 0 DISPLAY “Invalid times entered, the vehicle must arrive before it can leave” TRUE FALSE charge = 0 F vType DISPLAY “Data Entry Error” DEFAULT C B T G DISPLAY “PARKING LOT CHARGE” “Type of Vehicle: Car” DISPLAY “PARKING LOT CHARGE” “Type of Vehicle: Truck” DISPLAY “PARKING LOT CHARGE” “Type of Vehicle: Bus” C D E
C D E chargable > 3 chargable > 1 FALSE FALSE TRUE TRUE charge = (chargable - 3) * 1.50 charge = (chargable - 1) * 3.70 + 2.00 charge = chargable * 2.00 chargable > 2 FALSE TRUE charge = (chargable - 2) * 2.30 + 2.00 charge = chargable * 1.00 G H
F H DISPLAY “TIME IN“, hIn, “:”, mIn DISPLAY "TIME OUT”, phOut, “:”, pmOut DISPLAY "PARKING TIME”,, hDur, “:”, mDur DISPLAY "ROUNDED TOTAL“, chargable DISPLAY "TOTAL CHARGE “, charge STOP
getNum(low, high, val) getVehicle(v) DISPLAY “Type of Vehicle?” GET val GET v val < low OR val > high v != ‘C’ AND v != ‘T’ AND v != ‘B’ DISPLAY “Number must be between:, low, “and”, high, “, please re-enter: “ DISPLAY “Invalid vehicle type enter C, B or T :“ GET val GET v STOP STOP