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.
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.
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.
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.
A team's project will be evaluated by:
The evaluators also reserve the right to award bonus points to teams that develop projects of clearly superior quality.
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.