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

  Illustrate what action should metabo-miracle take

Thousands of consumers purchase the products and about 200 of those consumers call in with complaints the product was ineffective. Illustrate what action should Metabo-Miracle take?

  Explain reports are an essential part of communication

Explain Reports are an essential part of communication and as we have discussed, communication is best when it is targeted for its audience.

  Who would you involve in the testing

Illustrate what are some of the steps which you should consider in the graphic also information design for this site. Who would you involve in the testing?

  Letter saying no to solicitation for funds

Explain your new policy and refuse, as gently as possible, the request for a donation. Remember the goal is to refuse and still keep the people working with the organization as potential customers for your business.

  What is the organizational mission and purpose

Pick a company or organization if possible the organization or company for which you work. If you select to write about a company other than your employer gratify make sure it is one that has easily accessible information. What is the organization..

  Explain va-va-voom is ordered to include in all future

Explain Va-Va-Voom is ordered to include in all future advertising of Weight-No-More the statement

  Must employers have the right to monitor all e-mail

Must employers have the right to monitor all e-mail as well as instant messages that employees exchange on the job? First present the employer's position

  Describe the topic of transactional analysis

Explain how might transactional analysis help to better understand communication patterns and can a transactional analysis model be created

  Describe about reward structure

Reward structure - why it is possible for highly ethical leaders to preside over an organization that commits several unethical acts.

  Start our work measurement program

Work measurement is old hat. We have automated our office, and now we run every bill through our computer

  Red versus blue ocean in business

Provide an example of an industry experiencing a red ocean. In your opinion, how might the industry be converted into a blue ocean?

  Controllable margin and total contribution

The accounting manager has supplied you with this data and untraceable cost of $500,000. The accounting manager has supplied you with this data and asked you to come up with the controllable margin, total contribution, CPC, and operating income.

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