Description
Flashing Red Stop Light
Preliminary
A flashing red light means an approaching vehicle must stop before proceeding. When a standard traffic signal fails the back up software initiates a flashing red light.
Your assignment
Create a C# program. It outputs a virtual flashing red light in a frame that we call the user interface (UI). Here is a drawing of the UI your program will output.
The entire UI is one large graphical area. However, a “title panel” is drawn horizontally at the top of the UI and a “control panel” is drawn horizontally at the bottom of the UI. The fact is that the UI is one single graphical area, but the viewer sees it as a window with three panels:
title panel, graph area, and control panel.
Requirements and choices
- You as programmer may select another color scheme for your UI. The only rigid requirement is that the light must be red.
- You should create your own title for the program. Don’t depend on Linda Tran to choose the title for you. Obviously, you should remove Linda’s name completely. Your own name should be displayed as author of the program.
- Pick a nice even rate of flashing. Obviously, 20 times per second is too fast because the light appears to be one hazy blur. On the other hand if the interval of time between flashes is 30 seconds then the viewer will become bored waiting for the light to change. You run some experiments and choose a flash rate that the will appreciate.
- We do not allow tiny UI’s in this course. Suppose S is the size of your UI. Then S must be in this range: 1280×720 ≤ S ≤ 1920×1080.
1280×720 is generally called Standard Definition TV, or SD-TV.
1920×1080 is generally called High Definition TV, or HD-TV.
You pick a nice size between those two ranges.
- The “Pause Button” has two labels. When the program starts the label is “Pause”. When the user clicks on the Pause button the label changes to “Resume”.
- The “Exit Button” performs two actions, namely: stop the clock and close all the window. In this program there is only one window, and therefore, the Exit button must close the one UI.
- There are two C# source files and one Bash script file in this assignment. The first source file outputs a welcome message and then it launches the UI. When the program is ready to terminate the first C# source file output a nice good-bye message.
The second source file defines the UI and the components of the UI. This is where most of the programming is done.
The third file is called a script file. It is written in bash language. Its job is to compile the two C# files and then run the program.
- Put these comments at the beginning of the two C# source files. Immediately below is a sample of comments. You should use the sample as a pattern for the comments you will put in all your C# source files for the whole semester.
You use the same 6 items at the top of each of your source files. Obviously, you change the data to reflect your own program.
For the rest of the program you decide if you want to include comments. I high recommend that you place comments in the remainder of each of your source files, however, that is your choice.
What to do when you are finished.
Test the program one more time in a Linux distro like Tuffix. Does the program launch the UI in the middle of the monitor? Does the red light flash at an even moderate speed? Does the pause button really put the entire program on hold? Does a good-bye message appear when you click on “Exit”?



