+1-415-670-9189
info@expertsmind.com
For the fifa world cup 2006
Course:- Business Management
Reference No.:- EM13167046




Assignment Help
Expertsmind Rated 4.9 / 5 based on 47215 reviews.
Review Site
Assignment Help >> Business Management

For the FIFA World Cup 2006, a fly-over has been constructed between the hotel where the teams are staying and the stadium. This fly-over will be used by the German team and the Italian team in their upcoming exhibition match. A tram car is used to cross this

fly-over, but it seats only four people, and must always carry a full load.

We cannot put three Italians and one German in the same tram-car, because the Italians

would be in majority and might try to intimidate the German. Similarly, we cannot put

three Germans in the same tram-car with one Italian. All other combinations are safe.

You are required to code two processes; the first shall simulate the arrival of German

players and the other the arrival of Italian players. These players can come at any time, in any

order to cross the fly over. The first process shall call a procedure called GermanHere

on the arrival of a German player. Similarly, the second process shall call a procedure

called ItalianHere on the arrival of an Italian athlete. As soon as a safe combination

is reached, the tram starts and crosses to other side. Assume that a tram is always

available when required.

Use semaphores to implement the solution. The Germans and Italians should not wait if

there are enough of them for a safe tram-car load. The two processes will simulate the

arrival of players at random intervals and should run for a while to show around 10 trams

leaving with different safe combinations. Before terminating you must clean up the

semaphores and shared memory segments from the system.

You must output the progress of the processes. E.g. when a player arrives you should

output who arrived and also print the total number of Germans and Italians waiting to

board the tram. When a tram leaves you should output that as well.

Your code should include well written comments and at the beginning, you should

explain your strategy for solving the problem.




Put your comment
 
Minimize


Ask Question & Get Answers from Experts
Browse some more (Business Management) Materials
If a bank has 50 branches with 14 employees (4 supervisors, 10 tellers) per branch. They are placing 30 teller machines scheduled to be in operation December, 1 year from
1. The author of this article states that the way to encourage customer loyalty is through excellent and thorough service. Describe the provider's responsibility for establi
Discuss the difference between negligence and an intentional tort. Analyze and evaluate the various issues presented while arguing and debating the connections between busin
We are considering an event for next June. Assume if we select an outdoor venue, we make 350,000 dollars, but if it rains we lose 40,000. If we select an indoor venue, we make
Identify three weaknesses that you possess. Provide specific examples of how you could improve each of these weaknesses in order to make yourself a more well-rounded manager
Determine the company's resources, capabilities, and core competencies. Analyze the company's value chain to determine where they can create value using the resources, capabi
Imagine that you are the HR Director at your current organization or an organization with which you are familiar. As the HR Director, you must use different employment law r
Describe and evaluate how Pfizer is allowing employees to be more productive with its PfizerWorks. Compare this arrangement with other types of organizations and whether this