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

Here's the Model-View-Controller experimental "starter" code for this project produced in our lab/class on W May 24.

GRADING CRITERION:

  1. 75% correct execution
  2. 10% documentation
  3. 15% coding practices (maintainability etc.)

  IMPORTANT:  Coding Standards | GUI Checklist 

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:

  1. Please have your traffic light behave according to the finite state machine shown here.
  2. 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!
  3. Your application should produce a log file and an XML settings file.
  4. 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.
  5. The metadata (AssemblyInfo.cs), namespace and About form should be based on your name.
  6. Please make your executable ("assembly") file have a different name than standard.
  7. As shown in the image above and in my application, please append the short version number to the Window title.

GOALS:

  1. To practice constructing a Windows application outfitted with the infrastructure of a Standard Windows application
  2. To practice using a timer
  3. To practice implementing a finite state machine in a program
  4. 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:

  1. Here's a sample timer program.
  2. 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):


TURN-IN:
The turn-in procedure for programming assignments is as follows:

  1. Create a folder with your emailID as its name.  The folder I would create would be pgpalmer; yours will be different.
  2. Copy your Visual Studio solution and project, and all related files, into this folder.
  3. Test your copied program thoroughly to make sure it works.
  4. 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.
  5. 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).
  6. If correct, log into Blackboard and turn in the zip file (via file upload in your web browser).

Visitors: Hit Counter