Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Simple taxi emulator
- 1. Taxi station
- Consists of drivers and vehicles.
- There should be a choice function of driver / car for transportation to the customer
- by N kilometers.
- In taxi station there should be a cashbox. Replenished after customer is transported
- by N * 20 credits.
- If the client's luggage exceeds 30 kg, coefficient for charge is
- N * (Weight in overweight kg).
- 2. Driver
- It can be either on vacation or at work. Can get sick. We need a function
- managing these conditions, which could be used by a third-party code that uses
- this emulator.
- The driver has experience - the number of miles he drove carrying
- customers.
- The driver also has a "cash desk". He gets 15% of cash that taxi company gets from clients after every ride.
- Each driver has his own car.
- 3. Car
- Has mileage: N kilometers. Breaks regularly after every 50 thousand miles. For the sake of simplicity -
- it can only break after transporting the customer. Machine must always be repaired only
- with sufficient cash balance of taxis. Repair costs 10 000 rubles.
- The number of cars can be more than the number of drivers (but, for simplicity - no less).
- 4. Client
- It is one or more persons, as well as weight (in kg) of luggage.
- 5. Task is:
- To carry the client N km at an average speed X km / h. In this case, the user of this
- function must be given the opportunity to learn the parameters of selected
- driver / car.
- 6. There must be some function, we call it DoMainProcessing, that periodically
- gets called by an external source using the emulator (for example, every second or two).
- It should detect when the driver made the carriage of the customer (depending
- distance and average speed) and is ready to perform the next one. Then, it should
- repair the broken car (subject of availability of sufficient
- number of funds). The need for this function is dictated by, inter alia, the requirement
- of 8th point (see below).
- 7. Transfer of drivers / cars and their request parameters. Adding new drivers and
- machines.
- 8. Inquiry of taxi office funds.
- 9. The ability to send the selected driver on vacation, give him another machine.
- 10. The code must be thread-safe. You should use standard Windows features.
- 11. Use only standard
- C + + libs,
- STL
- and
- Windows API
- 12. It is forbidden to use additional threads. All the emulator's work should
- be done in the same thread / threads, which are used by programs that runs emulator.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement