Mathematics
Mathematics, 17.07.2019 23:00, kenziepickup

The longest rail tunnel, from hanshu to hokkaido, japan, is 18.2 mi longer than the longest road tunnel, from laerdal to aurland, norway. express the length of the longest rail tunnel in terms of the length l of the longest road tunnel.

answer
Answers: 1

Similar questions

Предмет
Computers and Technology, 06.08.2019 19:10, dirtridersteve65
Two mountain resorts are connected by a road that becomes single lane inside a tunnel that goes through the mountain. one resort is at the left end of the tunnel and the other at the right end of the tunnel. cars moving from left to right are called “right-bound” cars and are indicated with odd numbers starting from 1 (1, 3, 5, …). “left-bound” cars move from right to left and are indicated with even numbers starting from 0 (0, 2, 4, the tunnel can become deadlocked if a leftbound and a right-bound car enter into the tunnel at the same time. task: write a program that prevents the deadlock. you may use any synchronization technique. for example, semaphores would be good choice. you may ignore starvation, that is, the situation in which left-bound cars prevent rightbound cars to enter into the tunnel, or vice versa. you can assume that there will be steady stream of cars from each side, however, there can be more than one car from one side before we see a car from the opposite side. the tunnel may allow more than one car passing through it, but only in one direction.user is not expected to supply any input. the user will simply compile and run your program. a segment from a sample output could be like the following: … right-bound car 1 wants to enter the tunnel. right-bound car 1 is in the tunnel. right-bound car 1 is exiting the tunnel. left-bound car 4 wants to enter the tunnel. left-bound car 4 is in the tunnel. left-bound car 4 is exiting the tunnel. right-bound car 5 wants to enter the tunnel. right-bound car 5 is in the tunnel. left-bound car 8 wants to enter the tunnel. // note: car 8 cannot enter as car 5 is already in tunnel right-bound car 5 is exiting the tunnel. left-bound car 8 is in the tunnel. // note: now car 8 can go as car 5 has left the tunnel right-bound car 7 wants to enter the tunnel. // note: car 7 cannot enter as car 8 is already in tunnel left-bound car 10 wants to enter the tunnel. // note: the tunnel may have allowed 10 to enter left-bound car 8 is exiting the tunnel. left-bound car 10 is in the tunnel. // note: this could have been before the previous statement left-bound car 12 wants to enter the tunnelcaution: two cars from opposite sides cannot be in the tunnel at the same time. so if “right-bound car x in the tunnel” appears in the output with ‘x’ being odd, there must be a “right-bound car x exiting the tunnel” in the output before a “left-bound car y in the tunnel” appears in the output with ‘y’ being even. another caution: if ‘car m’ and ‘car n’ are waiting to enter tunnel from same direction, the car which is first will enter the tunnel first. also, once a particular car enters and then leaves the tunnel, it does not come back again to enter the tunnel. [hint: you may create two threads for controlling left-bound and right-bound cars. you may also use thread.sleep() with different sleep times for left-bound and right-bound cars when they enter tunnel. this would allow simulating different time taken to pass the tunnel. you may also use synchronized controller method and use wait() and notify()/notifyall() appropriately. ]
Answers: 2
Do you know the correct answer?
The longest rail tunnel, from hanshu to hokkaido, japan, is 18.2 mi longer than the longest road tun...

Questions in other subjects:

Konu
Physics, 17.02.2020 17:52