CSCI 201 Fall 2000

Assignment 4

Program 1: Work assignment number 6.1 on page 267 of the text

Write a program called grades.cpp to perform the task described in problem 6.1. Here is a text file of student grades that you can use to test your program. The program grades.cpp must be turned in by transferring it to your ftp directory for this class. Only the source code file should be turned in and it must be named grades.cpp.

Program 2: Work problem number 6.3 on pages 268-269 of the text

For this problem, you will write your own class called WordDice as described in problem 6.3. You will need to turn in both the class definition file, wordDice.h and the class implementation wordDice.cpp. This class is a modification of the Dice class that you used in the previous assignment. Here's a copy of the Dice class for you to modify dice.h and dice.cpp, along with the Randgen class ( randgen.h and randgen.cpp) because it is used by the Dice class. Once you have written the WordDice class, you can use this program to test it along this data file of words.

You may chose to use the StringSet and StringSetIterator classs when writing the WordDice class (but it's not required). If you wish to use these classes, here are the necessary files: stringset.cpp, stringset.h, tvector.txt, and tvector.h. All of these files must be included in the project folder for your program. Feel free to look at the .cpp files but remember that you don't need to understand the implementation of a class in order to use that class.

You do not need to test WordDice as many times as needed to generate all words in the text file---you may ommit that part of the problem description on page 269.

When submitting your solution to this problem, be sure to transfer both wordDice.h and wordDice.cpp to your ftp directory for this class.

Programming Style

Note that 10% of your program grade is based on the readability of your program. This includes things like style, comments, and the naming of variables and functions. Make sure you include a comment at the top of each program with your name, course and purpose of the program specified.

// Name: YOUR NAME HERE // // Course: CSCI 201 // // Purpose: purpose of program here //

Submitting Programs

As stated above, the programs written for this assignment must be turned in by transferring the C++ source code files to your ftp directory for this class. Only the files grades.cpp, wordDice.h and wordDice.cpp should be turned in. You were shown how to transfer files to your class ftp directory in lab01, here is a quick repeat.