Write an application to simulate the vehicles crossing a toll - TopicsExpress



          

Write an application to simulate the vehicles crossing a toll bridge on a motorway. For the purpose of this exercise, simulate the environment for five vehicles that are approaching the bridge and the toll booth. The vehicles are numbered from one to five. The vehicles have to go through the following five stages. Start the journey. Arrive at the toll. Enter toll booth. Exit the toll booth. Cross the bridge. The vehicles can be in any of the stages in parallel, except the third stage as only one vehicle can enter the toll booth at a time. The simulation is performed by having one thread for each vehicle, and consists of the following classes: Vehicle: Simulates the behavior of a vehicle. TollBooth: Simulates the behavior of a toll booth. Simulate: Creates the vehicles and controls the simulation Huhu. Có ai giỏi tiếng anh làm ơn dịch dùm tớ cái này.
Posted on: Sun, 23 Jun 2013 08:23:15 +0000

Recently Viewed Topics




© 2015