3. Write pseudo-code that manages a railroad crossing with aone-way street with car traffic. Your solution should usesemaphores and the following rules should be satisfied:
A). A car and a train can’t cross the intersection at the sametime
B). A vehicle arriving at the intersection should be allowed tocross if there is no vehicle approaching from the otherdirection.
C). If there are vehicles approaching from both directions, thetrain should receive priority.
Expert Answer
An answer will be send to you shortly. . . . .