1. The lights in your system need to change color based primarily on the passage of time. Add C#time library System.Diagnostics into your program and use the C# statements:using...




using a WPF gui interface and C#:


1. The lights in your system need to change color based primarily on the passage of time. Add C# time library System.Diagnostics into your program and use the C# statements: using System.Diagnostics; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); stopWatch.Stop(); 11 Get the elapsed time as a TimeSpan value. TimeSpan ts = stopWatch.Elapsed; Console. Writeline("Elapsed time = ", ts.Seconds); to create a variable "ts" that will contain the number of seconds that have passed. Start the stopwatch at the start of your program and measure the passage of time from this point on in order to measure the passage of time in your program. 2. Change your program so that green lights last for 9 seconds, yellow lights last for 3 seconds and red lights last until the light turns green again. The North light goes green first, and the South light goes green after the North light has been green for 6 seconds. The North light will then turn Yellow after 9 seconds. The East light will then go green when the South light turns Red. Repeat this sequence for the East and West lights with the West light finally setting the North light Green as it turns Red. 3. Priority support for Smallville emergency vehicles needs to be added. A special broadcast unit on an emergency vehicle will inform one of the four lights that an emergency vehicle is approaching. Add a logic to your program that will cause the light that the emergency vehicle is approaching to turn green and all other lights to turn red until the light gets triggered again to indicate that the emergency vehicle has passed by. When the emergency vehicle is gone, the green light will pass to the next light in the sequence after the light that the emergency vehicle used. 2. Your software system will have to model 4 separate stoplights that can display one of three different colors at any time: red, yellow, or green. The four lights each point in a different direction: North, South, East, and West. You should also display the current time of the simulation. 3. Create a WPF GUI to show the current color that is being displayed by each traffic light. North South East West Time: 00:00 4. Initialize the system to a starting configuration where the North ligh other lights are displaying red. displaying green and all 5. Run the program for 60 seconds. Print out a complete display of the current state of each light every time alight changes color and print the current time. See below for the sample output format. Update your graphical display to show the current state of each light. 6. At35 seconds into the simulation, simulate an emergency vehicle approaching the East traffic light. 8 Run the system until you reach the 60 second mark and then terminate the program. « Youare only permitted to use the C# commands that we have covered in class so far. Yes, there are many more, but no, you can't use them in solving this homework! « Youmust use a class in your solution. © You must declare at least 4 objects in your solution. «The output of your prograr assignment in order to simy tobe in the 5 column format shown at the end of this homework the grading process. «No hardcoding of a solution is permitted. Your program should be able to be run for any amount of time (e.g. two days) and produce the correct output for the entire time.
Dec 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here