Programming Project 3
Parking Lot
Type First Rate Second Rate First 3 Hrs After 3 Hrs Car $0.00/Hr $1.50/Hr Truck $1.00/Hr $2.30/Hr Bus $2.00/Hr $3.70/HrThe functions you will write, in addition to the main function, are:
#define HOUR_MIN 0 #define HOUR_MAX 23 #define MINUTE_MIN 0 #define MINUTE_MAX 59 #define HOURS_FIRST_RATE 3 #define CAR_FIRST_RATE 0.00 #define CAR_SECOND_RATE 1.50 #define TRUCK_FIRST_RATE 1.00 #define TRUCK_SECOND_RATE 2.30 #define BUS_FIRST_RATE 2.00 #define BUS_SECOND_RATE 3.70
linux3[1]% a.out [Your greeting goes here.] What is the type of vehicle? Please enter 'C' for car, 'T' for truck or 'B' for bus: C What is the hour the vehicle entered the lot? Please enter a number between 0 and 23: 10 What is the minute the vehicle entered the lot? Please enter a number between 0 and 59: 30 What is the hour the vehicle left the lot? Please enter a number between 0 and 23: 16 What is the minute the vehicle left the lot? Please enter a number between 0 and 59: 0 ----------------------------- BUBBA'S PARKING LOT RECEIPT Type of vehicle: Car Time-in: 10 : 30 Time-out: 16 : 00 --------- Rounded Hours 6 --------- Total Charge 4.50 Have a nice day! ----------------------------- linux3[2]% a.out [Your greeting goes here.] What is the type of vehicle? Please enter 'C' for car, 'T' for truck or 'B' for bus: t What is the hour the vehicle entered the lot? Please enter a number between 0 and 23: 8 What is the minute the vehicle entered the lot? Please enter a number between 0 and 59: 15 What is the hour the vehicle left the lot? Please enter a number between 0 and 23: 12 What is the minute the vehicle left the lot? Please enter a number between 0 and 59: 30 ----------------------------- BUBBA'S PARKING LOT RECEIPT Type of vehicle: Truck Time-in: 08 : 15 Time-out: 12 : 30 --------- Rounded Hours 5 --------- Total Charge 7.60 Have a nice day! ----------------------------- linux3[3]% a.out [Your greeting goes here.] What is the type of vehicle? Please enter 'C' for Car, 'T' for truck or 'B' for bus: F You must either enter 'C' for Car, 'T' for Truck or 'B' for Bus. Please try again: f You must either enter 'C' for Car, 'T' for Truck or 'B' for Bus. Please try again: B What is the hour the vehicle entered the lot? Please enter a number between 0 and 23: 100 The number must be between 0 and 23. Please enter another number: -3 The number must be between 0 and 23. Please enter another number: 2 What is the minute the vehicle entered the lot? Please enter a number between 0 and 59: 70 The number must be between 0 and 59. Please enter another number: 6 What is the hour the vehicle left the lot? Please enter a number between 0 and 23: 9 What is the minute the vehicle left the lot? Please enter a number between 0 and 59: 0 ----------------------------- BUBBA'S PARKING LOT RECEIPT Type of vehicle: Bus Time-in: 02 : 06 Time-out: 09 : 00 --------- Rounded Hours 7 --------- Total Charge 20.80 Have a nice day! -----------------------------
Here is a sample submission command. Note that the project name starts with uppercase 'P'.
submit cs104 Proj3 proj3.c
To verify that your project was submitted, you can execute the following command at the Unix prompt. It will show the file that you submitted in a format similar to the Unix 'ls' command.
submitls cs104 Proj3