CS 2704 : Project #1


Assigned: September 25
Intermediate Demonstration: October 9
Final Demonstration: October 21
Points: 50



Introduction

The goal of this project is to develop an interactive system with a graphical user interface. The system's construction will use several of the classes that have been worked with in the exercises and as well as several new classes that you will developed specifically for this project. The project differs from the exercises in that you will be developing new classes and not simply using existing classes.

One of two interactive systems can be developed: a slot machine interactive game or a test administrator for a mutliple choice test. The development team is free to choose either system to develop for this project. The two systems are of equivalent difficulty.

The basic functionality of the two systems is given below. However, the "look and feel" aspects of the two systems are left to the development team. Both systems use a variety of Frame, Message, TextBox, Button, and Clock objects in addition to objects of any new classes that must be developed.

Programming Teams

The interactive system will be developed by a team of two people. Each of the team members is expected to contribute equally to the development of the system. Each team member will receive the same grade for the project. A student should inform the instructor at the earliest possible time of a situation where the student's partner is not contributing equally to the project's development. It is considered a violation of the Honor Code to allow a team member to contribute less than an equal amount.

Each team must send email to the instructor by the next class meeting after this assignment is given. This email message should give the full names of the two team members.

Slot Machine

A slot machine is a game of chance. The player begins with a certain amount of money to wager. On each turn the player bets a portion of the player's current money. After betting, the player initiates the machine's "play". The slot machine has three "windows", each of which displays one of a set of symbols (words, or patterns made of characters). On each play the three windows begin spinning. One at a time the windows stop spinning and show their values. The values are selected randomly from among the set of symbols that can appear in a window. If no two windows show the same value, the amount of money bet is subtracted from the players amount of money. If any two of the windows shows the same value, no change is made in the player's balance. If all three values are the same, the player's amount of money is credited twice the amount bet. Each team is free to change the rules of the game to suit their preferences as long as the fundamental aspects of the game are preserved (e.g., its overall appearance and functionality).

The slot machine user interface should have a "play" button, an area that show the current balance, an area that shows the current wager, and three areas that show the three "windows". In addition the names of the team members must be shown at the top of the display.

To give the slot machine a realistic feeling, the three "windows" should have a "spinning" effect. A clock with a small interval (100 milliseconds) should be used to rapidly change the values in the window to create an effect that is suggestive of "spinning". Mulitline patterns using "/", "\", "(", or ")" characters might be considered. Some experimentation with different character patterns or different clock intervals might be needed.

To build a slot machine program, a random number generator will be needed to select randomly among the set of symbols that can appear in each of the spinning windows. See the man pages for "random" (Section 3 of the man pages) for some helpful utility functions. In using these, or any other C language functions be sure that you think in an "object-oriented" way.

Test Adminstrator

The Test Administrator supervises the taking of a multiple choice test by the user. The system interacts with the user to determine which of several tests might be taken, presents the questions, receives and evaluates the answers, and displays a record of the user's performance during the test.

Once the test administrator programming is run, the user must press an indicated button to initiate a test. In response, the system interacts with the user to select a file that contains the test. Each test file contains a series of questions, three possible answers, and an indication of which of the three answers is the correct answer. The detailed layout of the file is left to each team.

For each question on the test, the test administrator displays to the user the question and the three possible answers. The systems waits for the user to select an answer by pressing one of three buttons, each button corresponds to one of the three possible answers. The system then determines if the selected answer is correct.

The test administrator maintains and displays two measures of user performance: (1) a display of the current number of correct vs. incorrect answers that is updated after each question is answered, and (2) a display showing the number of seconds that have elapsed since the first question was displayed.

The test adminstrator terminates either when there are no more questions in the file of test questions or when the user depresses a "quit" button.

Finally, the names of the team members must be shown at the top of the display.

Evaluation

A live demonstration conducted in the McBryde 116 lab must be given by each team on the due date. A sign-up sheet will be distributed in class prior to the due date. Each team must sign up for one of the demonstration time slots. In addition to the live demonstration, each team must submit a printed listing of their code. The printed listing must give the name of the two team members.

A team's project will be evaluated by:

  1. whether it meet the functional specifications given, and
  2. whether the newly developed classes are well done.
The evaluators reserve the right to deduct points for egregious violations of reasonable user interface standards or coding practices.

The evaluators also reserve the right to award bonus points to teams that develop projects of clearly superior quality.

Available Code

The project requires the use of many of the classes that were used in the exercises as well as the development of new classes. The new classes are needed to define the actions that occur when specific buttons are pressed or when the end of a time interval in a Clock object is reached.

To keep your project work isolated from the details of the underlying windowing system, a collection of anonymously named classes is available. These classes provide an assortment of Buttons and Clock actions. These classes have no code or data defined for them - each team can edit these classes to add the code and data needed for their project. It is not necessary to use all of these classes. In addition, each team will find it necessary to develop other, application specific classes.

The available classes are provided in the file project1.tar that can be be obtained via anonymous ftp from ftp.cslab.vt.edu in /CS/2704. The anonymously named Button actions are contained in the files ButtonActions.h and ButtonActions.cc. The anonymously named Clock actions are contained in the files ClockActions.h and ClockActions.cc. These files are intended to be edited by each team to add whatever application specific code is needed when a given button is pushed or a given clock event occurs. The Clock class has been modified so that a Clock object can be connected to one or more of the ClockActions (in addition to being connected to a Counter object). The Frame class has been modified so that any of the anonymously named buttons (see GenericButtons.h and GenericButtons.cc) can be displayed in a Frame.