Question: traffic light simulator please follow the instructions carefully Objective Direction License Time Plate This assignment will introduce you to the process creation mechanism in UNIX

traffic light simulator

please follow the instructions carefully

traffic light simulator please follow the instructions carefully Objective Direction License Time

Objective Direction License Time Plate This assignment will introduce you to the process creation mechanism in UNIX using the fork function. DEF CDE FGH ABC EFG BCD Specifications 2 You must write a program to simulate a traffic light controlling how cars use a four-way intersection. Each road has a direction (northbound, southbound, eastbound, and westbound). Your program will receive from STDIN the information about the parameters of the traffic light and the cars that want to cross the intersection. After defining the order that the cars will follow to use the intersection, your program must create a child process per car. Each child process will print the information about the car and will sleep for the number of seconds specified in the input file 2 Implementation You will have two types of processes 1. Parent process: is the process that reads the input file, defines the order that cars will follow to use the intersection, creates the child processes (one at a time), prints the current direction of the traffic light (per each direction change), and waits for all the child processes to complete before ending its execution Input Format: Your program should read its input from stdin (C++cin) and use input redirection as in assignment1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!