For the fifa world cup 2006

Assignment Help Business Management
Reference no: EM13167046

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.

Reference no: EM13167046

Questions Cloud

Explain the concept of locality of reference : 1. Explain the concept of locality of reference and state its importance to memory systems.
Which a ball is released from a user-defined height : Write a program in which a ball is released from a user-defined height and free-falls to the ground. The ball is pulled by earth's gravity of 9.8 m/sec 2 . Assume that each pixel represents
Create a text-based, menu-driven program : Create a text-based, menu-driven program that allows the user to choose whether to add, subtract, multiply or divide two numbers. The program should then input two double values from the use
Search the web for security education and training program : Search the Web for security education and training program in your area. Keep a list and see which category has the most examples. See if you can determine the costs associated with example. Which do you think would be more cost-effective in terms of..
For the fifa world cup 2006 : 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 t..
Write a java program that reads a five-line address : Write a Java program that reads a five-line address from an input file and produces an output file with the address repeated 50 times in three columns.
Define a class called counter : Define a class called Counter. An object of this class is used to count things, so it records a count that is a non negative whole number. Include methods to set the counter to 0, to increase the count by
Prompts for an int8 value to inspect and then prints : Write an HLA Assembly program that prompts for an int8 value to inspect and then prints it in binary format.
Temporarily move to the street so that the : Driveway is a "last-in, first-out" stack. Of course, when a car owner retrieves a vehicle that wasn't the last one in, the cars blocking it must temporarily move to the street so that the requested vehicle can leave

Reviews

Write a Review

Business Management Questions & Answers

  Define the roles of the primary and secondary facilitator

Define and explain the roles of the primary and secondary facilitator and Why is it important to switch hats when in one of these roles?

  Explain what are the benefits of a strong work team

What indicators would warn you that the team that is planning this transition to an electronic health information management system is not functioning well?

  Explain what factors should be considered in price setting

Explain What factors should be considered in price setting and Which of these factors is most important? Why and Why is adapting the price of a product important?

  Elucidate how does ball use operations management stay

Elucidate how does Ball use operations management to stay competitive in the metal beverage containers industry?

  Briefly define positive and negative reinforcement

Briefly define positive and negative reinforcement, punishment and extinction. Then consider your individual experiences from when you were younger or while interrelating with children

  Elucidate how many units should be ordered

The review period is 10 days and the lead time is 6 days. At the time of review there are 50 units in stock. If 98 percent service probability is desired, elucidate how many units should be ordered?

  A domestic corporation seeing expanding into international

A domestic corporation seeing expanding into international markets for the first time will typically

  Developing a new product for shamroll inc

Shamroll inc. is a household products firm that is considering developing a new detergent. In evaluating whether to go ahead with the new detergent project, which of the following statements is most correct?

  Critically inspect your personal level of intercultural

Critically inspect your personal level of intercultural communication competence. Is it significant for you to achieve a certain level of intercultural communication competence?

  Communication to group of newly hired employees

You need to prepare your first presentation on appropriate communication to a group of 20 newly hired employees for their orientation. The profile of the group is as follows.

  Two things shared by many industries with highly motivated

Acceptance of scientific management and centralized decision-making. Clear distinctions between managers and workers and a simple line and staff organizational structure.

  How can bill improve his quality of work

Leadership: Bill's weekly magazine and how can Bill improve his quality of work

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd