CPS613

F2017 Assignment

Ryerson University

Racing Timer

Due: October 6


Objectives

The objectives of this assignment are
  • How to use a variety of VB controls.
  • How to define and use your own controls which include user-defined properties that work interactively in Visual Studio.
  • Familiarizing yourself with OOP programming in VB.
  • How to structure projects.

Assignment Description

In this assignment you will be developping a timer/stopwatch for international racing competitions that has the same functionality and interaction as this example. Here are some additional details:

Handouts

This directory contains handouts of the flags and national anthems that I used in my version of the assignment. Feel free to use them in your assignment(or your own if you prefer).

Bug Reports

You can report bugs in the example Racing timer in the D2L "Assignment Bugs" forum. The first student to report each bug (to be confirmed by instructor) will get bonus marks on the assignment.

References

In addition to the links in the Implementation requirements, here are some more elaborate references for this assignment:

  1. The MSDN Visual Basic References should help you with the controls and the VB language.

  2. Specific references for the assignment and modules. In particular you will want to read the sections on:
    • User-defined controls. The only part of this page which is not relevant to this assignment is the section on dynamic control generation.
    • Timer to make your clock work.

Development Suggestions

  • I would suggest that you develop this application incrementally and test it very often. Visual Studio makes this very convenient as you can rebuild and rerun your application very easily.

  • It is very easy to create lots of controls in VB that you will have a hard time finding later on because they all have names like Button1, Button2, Button3, etc. If you keep these default names, you will have a very hard time understanding your own code whenever you leave it for a while and return to it. It is strongly recommended that you give good names to your controls as soon as you create them. You will thank yourself for this very quickly.

  • TO AVOID UNNECESSARILY REDOING YOUR WORK, CHECK THE IMPLEMENTATION REQUIREMENTS BEFORE YOU START IMPLEMENTING FEATURES.

  • There is a lot of stuff in this application and it may not be clear where to start. I would suggest that you first create the main form with the 3 tabs and then develop the tabs from left to right as they increase in difficulty. Here is a suggested order of development for this assignment.
    • For the Athletes tab:
      1. Layout the 10 radio buttons and figure out how to write one handler for all 10. This handler could simply put up a message box with the number associated with the radio button.
      2. You will probably want to develop the LaneDefinition control: make the ListBox selection print out the index of the selected country, and also make the Position property work.
      3. Put 10 LaneDefinition controls in the tab, write code to put these controls in an array, and then modify the radio button handler to use 2 loops to enable some lanes and disable the others.
    • For the Race tab:
      1. Develop the TimeDisplay control and test its methods with buttons that invoke it.
      2. Develop the RunningTimeDisplay control and test it out with buttons as well.
      3. Develop the RacingLane control and its Position property.
      4. Add 10 RacingLanes to the second tab, put them in an array for easier access, and modify your LaneDefinition control so that a change in a one of the 10 instances of LaneDefinition is reflected in the associated RacingLane (e.g. changing the athlete name in the 5th LaneDefinition changes the athlete name in the 5th RacingLane).
      5. Embed all the flags into your application, save them in an array, and change the country ListBox selection in LaneDefinition so that a change in the country in LaneDefinition result in a changed flag in the associated RacingLane.
      6. Make the start/stop button work with a random number generator to pick winners and record their times.
      7. Make the rest button work too.
    • For the Results tab:
      1. Design the Result control and its 2 layouts, depending on the value of the Position property. (see User-Defined Properties that Change a Control's Layouts)
      2. Lay out the 10 results the controls on the Results tab and put these controls in an array for easier access.
      3. modify the reaction to the stop button so that each winner is immediately ranked as soon as s/he finishes the race and his/her rank and information is recorded in the Results tab in addition to the time being recorded in the Race tab.
      4. Make the flag animation feature work.
      5. Make the national anthems feature work.
    • For the whole application:
      1. Write code to enable and disable various parts of the application depending on how far along the race is.
      2. Write code to start and stop playing a national anthem depending on which tab is clicked.

  • One of the keys to making this assignment manageable is to make sure in your OOP design that you allocate the work where it belongs. For this purpose, objects will need to send messages to other objects or classes to delegate work to them. Please check the class diagram, of the sample solution for suggestions as to which objects each class or each instance should keep a reference to (in the Fields section and arrows) and which work should be performed by each instance or class (in the Methods section). Then make sure that these references to other objects are properly passed at run time to the classes or instances who will need to use them.

How to submit the assignment:

This is an electronic submission. Zip up the folder containing your entire assignment, including all the source code since some of it will be graded as you can see in the rubric, and submit it on D2L to the "Assignment" folder.


This page is maintained by Sophie Quigley (cps613@scs.ryerson.ca)
Last modified Sunday, 24-Sep-2017 09:44:21 EDT