Advertisement
Guest User

description

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