Project #1 -
Traffic Light simulator - 5%
due by midnight, M May 29
Deduction for lateness is 10% per day for 5 days,
then no credit. Start early!
Version 1.1,
last updated
05/24/2006
- added class code directly below
|
GRADING CRITERION:
- 75% correct execution
- 10% documentation
- 15% coding practices (maintainability etc.)
Using Microsoft Visual C#, write a Traffic Light simulator that adheres to
all specifications of the Standard Windows
Application. This project requires that you drop a
Timer onto the main form from the VS.NET toolbox. The form will look
something like this (but may implement your own colors/icons):

RULES:
- Please have your traffic light behave according to the finite state
machine shown here.
- Please have your traffic light simulator behave like
my prototype (download and run it to see
how it acts).
DISCLAIMER: This prototype does not implement all features, is not
guaranteed to be robust, and may not conform to look and feel standards for a
standard application!
- Your application should produce a
log file and an XML settings
file.
- Make sure your Main form Options allow
the durations of the states to be modified in various specific ways like my
program does. NOTE: Since this is a single-threaded application, I
needed to disable the Options menu while my timer was running; you will likely
need to do the same.
- The metadata (AssemblyInfo.cs), namespace and About form should be based
on your name.
- Please make your executable ("assembly") file have a different name than
standard.
- As shown in the image above and in my application, please append the short
version number to the Window title.
GOALS:
- To practice constructing a Windows application outfitted with the
infrastructure of a Standard
Windows application
- To practice using a timer
- To practice implementing a finite state machine in a program
- To show that a program with a lot of Timer action might benefit from being
multithreaded (but don't do that in this assignment, please!)
SPECIAL NOTE on Timers:
There are two timer controls in the Toolbox view of VS.NET, one in "Windows Forms"
tab and
another in "Components" tab. I suggest using the one in "Windows Forms".
The two timers are in fact very similar; the only difference is, if your timer
handling method takes too long so that a timeout gets missed, the
"Windows Forms" version skips the missed event. But the other timer queues up
timeouts so they are never missed (though they may be issued all at once after
the handler completes a long run). For now, just use the "Windows Forms"
timer, which is the one that you'll likely see by default when you first open
the Toolbox view in VS.NET.
RESOURCES:
-
Here's a sample timer program.
-
Here's info on
finite state machines
(needed to track where you are in lighting the traffic light).
GETTING HELP:
If you need help, try (in preferred order):
- posting to the Discussion Group in Blackboard
- call or find me or a TA
- send email (last resort)
TURN-IN:
The turn-in procedure for programming assignments is as follows:
- Create a folder with your emailID as its name. The folder
I would create would be pgpalmer; yours will be different.
- Copy your Visual Studio solution and project, and all related files, into
this folder.
- Test your copied program thoroughly to make sure it works.
- When fully tested, zip up the entire folder, including all files
underneath the folder.
NOTE: Please do not use the "save full path info" option.
- Test unarchiving the zip file to make sure it produces all your files and
directories, but in whatever folder the person unzipping chooses (such as, on
the Desktop).
- If correct, log into Blackboard and turn in the
zip file (via file upload in your web browser).
Visitors:
