Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.14 KB | None | 0 0
  1. Project 1
  2.  
  3.  
  4. Objective:
  5. The purpose of this lab project is to expose you to selection, loops and enforce the use of functions.
  6.  
  7. Problem Specification:
  8. Passaic County Parking Authority needs a C++ program to compute and print for customers, who park in their parking lot, a statement detailing the parking fare when the following information is given:
  9. a. A character showing the type of vehicle:
  10. ‘C’, ‘c’ for car
  11. ‘V’, ‘v’ for Van
  12. ‘S’, ‘s’ for SUV
  13. ‘B’, ‘b’ for bus
  14. ‘T’, ‘t’ for truck
  15. b. An integer between 6 – 23 showing the hour the vehicle entered the lot.
  16. c. An integer between 0 – 59 showing the minutes the vehicle entered the lot.
  17. d. An integer between 6 – 23 showing the hour the vehicle left the lot.
  18. e. An integer between 0 – 59 showing the minutes the vehicle left the lot.
  19.  
  20. This is a public lot. To encourage people to park for short period of time, the county uses two different rates for each type of vehicle, as shown in the table below.
  21. Type
  22. First Rate
  23. Second Rate
  24. Car
  25. $0.00/hr. first 3 hours
  26. $1.50/hr. after the first 3 hours
  27. Bus
  28. $1.00/hr. first 2 hours
  29. $2.50/hr. after the first 2 hours
  30. Truck
  31. $2.00/hr. first hour
  32. $3.50/hr. after the first hour
  33.  
  34. Input data consists of a vehicle type and 4 integers representing entering and leaving hours and minutes. In a user friendly way (using prompts). Write a program to read the data from the keyboard, compute the customer’s bill, and print an appropriate statement.
  35. Typical data entered
  36.  
  37. B, 14, 23, 18, 8
  38.  
  39. Where B indicates Bus,
  40. 14 represent 2:00 PM
  41. 23 represent 23 minutes after 2:00
  42. 18 represent 6:00PM and
  43. 8 represent 8 minutes after 6:00.
  44.  
  45. Requirements:
  46. Lot is open from 6:00AM to midnight.
  47. No vehicle is allowed to stay in the parking lot later than midnight and will be towed away.
  48. Charges are in increments of hours, if parked 2 hours and 1 minute, its 3 hours.
  49. Cars, Vans and SUV’s are treated as Cars
  50. Trucks are two classes (‘S’ or ‘s’ for small, uses Bus Rate and ‘L’ or ‘l’ for large uses Truck Rate.
  51. Comment thoroughly. Include: your name, course #, date, program name and a brief explanation of what does the program does.
  52. Follow good structured programming practices,
  53. Should do the hierarchical chart first
  54. Should do a flowchart/algorithm next
  55. Define constants as you see fit. If you have to, define the constants locally.
  56. Pass by value and by reference as needed
  57. Use at least 3 functions to represent input, process and output.
  58. Each function must have specifications.
  59. Output the result as shown below.
  60.  
  61. Additional requirements
  62. A prompt controlled loop to allow us to enter new data set or leave the program.
  63. Validate the data such that only valid vehicles are allowed to enter the lot including small trucks and large trucks.
  64. Validate the data such that the Time-in is less than the time-out.
  65.  
  66.  
  67.  
  68. Output for the program for each data set is as follows.
  69.  
  70. Passaic County Parking Authority
  71.  
  72. Parking Lot Charges
  73.  
  74. Type of Vehicle: Bus
  75.  
  76. Time–In 2:23 PM
  77. Time–Out 6:08 PM
  78. ____________
  79. Parking-Time 3 Hrs:45mins
  80.  
  81. Rounded Parking Time 4 hours
  82. ____________
  83.  
  84. TOTAL DUE $6.00 // Makes no sense; 4 => 2 + 2 => 2*1 + 2*2.5 = 7
  85.  
  86. Thank you for using Passaic County Parking Authority
  87.  
  88. Do you have another vehicle? (Y/N)
  89.  
  90.  
  91. Grading criteria:
  92. 5 points Good programming practices: Proper spacing, comments, use of variables, indentation and appearance of program.
  93. 5 points constants are used.
  94. 10 points Flowchart or algorithm for the function main only is handed-in and is correct.
  95. 5 points Hierarchical chart is handed-in and is correct.
  96. 5 points Proper heading and footing is printed.
  97. 5 points output is aligned and looks good.
  98. 15 points functions are properly used; parameters are properly passed.
  99. 5 points calculations are used correctly and the correct results are printed.
  100. 10 points a prompt loop is used to enter another vehicle’s data.
  101. 10 points all data entered is validated and messages are printed for incorrect data.
  102. 20 points Program runs correctly and produces the intended results.
  103. 5 points program runs and tests all given data below.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement