There is the next task I have :
Create an application that represents a Taxi station with 10 taxies. Taxi station enables: -Order taxi -Cancel taxi -Be aware when taxi gets available A person that orders a taxi may be a regular customer or a VIP customer. If a VIP orders a taxi, he/she should be first in line regardless of the time he requested the service. Where no taxi is available, a person should be kept on the waiting list. When a taxi becomes available, a person according to priority gets the free taxi. Print to console every reservation accepted/queued. Execute:
- Create a taxi station with 10 taxis
- Order a taxi for 9 regular persons
- Order a taxi for 1 VIP person
- Order taxi for 2 regular person
- Order a taxi for 1 VIP person
- 1 Taxi is back in the station
- Order a taxi for 1 VIP person
- the Second taxi is back at the station
- Third taxi is back at the station
So, the question is: Which design pattern fits the most to this task? How would you solve this case? Thanks in advance!
Aucun commentaire:
Enregistrer un commentaire