Write a C++ program to simulate the machine at each of the three gates(A,B,C). T
ID: 3571464 • Letter: W
Question
Write a C++ program to simulate the machine at each of the three gates(A,B,C). The visitor will choose any of the three gates to get into to the parking lots; your program should allow the visitor to choose the gate. The machine display at Gate-A at any random moment. The program should also display a message at the bottom of the machine display asking the visitor about his/her preferred criteria of choosing the parking lot.
The following are the criteria for choosing the parking lot:
• If the visitor prefers to choose the parking lot based on the distance from the selected gate, then the program should automatically direct the visitor to the closest parking lot to that gate, which still has at least one available parking spot. If parking spots are available at two or more parking lots which are at equal distances from the gate, then the program should automatically choose one of the lots based on the chronological alphabetical order. The program should next display a message showing the name of the chosen parking lot and the required amount of money.
• If the visitor prefers to choose the parking lot based on the cost in $DD.CC, then the program should automatically direct the visitor to the parking lot which has the cheapest cost. If parking spots are available at two or more parking lots where the parking cost are the same, then the program should automatically choose one of the lot based on the chronological alphabetical order.
Next, the program should display a message showing the name of the chosen parking lot and the required amount of money. Next, the program should ask the visitor to enter money. The machine can only accept the 1, 5, 10 and 20 dollar bills and coins in the form of quarters only. No credit card payment is allowed; the machine accepts cash only. If the visitor enters the exact required amount of money, then the program should display the message “thank you – Gate is now open”. If the visitor enters money exceeding the required amount, then the program should return change and display a message “thank you – Gate is now open, your change is: $DD:CC”. You will need to replace the DD with the dollar amount and the CC with the cent amount. If the visitor enters money less than the required amount, then the program should keep asking the visitor to enter more money until the exact required amount is entered or exceeded. The program should next display either one of the two message “thank you – Gate is now open” or “thank you – Gate is now open, your change is: $DD:CC” based on the amount of money that was entered by the visitor.
Finally, the program should update the records of money in the cash register and subtract one from the available parking spots from the chosen lot. The program must start with some money in the cash register of each machine. At the beginning, each machine has 500 quarters, 400 one-dollar-bill, 300 five-dollars-bill, 200- ten-dollars-bill and 50 twenty-dollars-bill. The machine usually returns change in forms of biggest possible bill(s).
The program must start while the parking lots are partially filled. The university allows some emergencyemployee to park during the game time at any of the available parking spots. Each of the parking lots can be partially filled up to a 10% of its maximum capacity. You will need to use a random number generator to partially fill the parking lots at the beginning of your program. Please note the number of emergency-employee cars in any parking lot can be in the range from 0% to 10% of the maximum capacity of each lot. Once all lots are filled, the program should display the message “All parking Lots are full – Sorry!!”.
Finally, the program should have an option to save the final information into a file for later analysis by the university. Information to be saved into the file should include,
1. Total number of visitor cars at the end of the day.
2. Total number of emergency-employee cars
3. Total money in the cash register at that moment
4. Total money visitors paid till that moment.
Sample Ouputs
Thank you, any help is welcomed!
Parking Machine Accounts BILL COUNT COST in Sr. No BILL NAME One Dollar 400 400 2 Five Dollar 300 1500 3 Ten Dollar 200 2000 4 Twenty Dollar 50 1000 5 Quarter 500 125 Total bill types Found Total credit available 5025 Which Gate do you wish to Enter 1 Gate A 2 Gate B 3 Gate C A. Print the Report to a File EXIT Enter Gate option (1-3Explanation / Answer
Write a C++ program to simulate the machine at each of the three gates(A,B,C). The visitor will choose any of the three gates to get into to the parking lots; your program should allow the visitor to choose the gate. The machine display at Gate-A at any random moment. The program should also display a message at the bottom of the machine display asking the visitor about his/her preferred criteria of choosing the parking lot.
The following are the criteria for choosing the p
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.