CSCI 201

Fall 2001

Assignment 5


Part 1: Reworking Assignment 4 Using Arrays

Description:

You are given a zipped project folder as a starting point for this assignment, but you do not need to do more than look at it. When you unzip the file, you will find that the project folder is a slightly modified version of the folder that you received for assignment 4; it contains the following files:

The purpose of this program is, as it was in assignment 4, to create an ASCII version of a totem pole. The only difference between this assignment and assignment 4 is that you are to use an array in two places:

The declarations for these arrays are in the appropriate places in the assign5 project given to you on the link above. Note where and how these arrays are declared---you must use those declarations in your modified program.

Your Task:

Modify your assignment 4 program to use the two arrays described above. The only classes that you will have to modify are the TotemPole class and the Head class. When you have completed the necessary modifications, submit the modified versions of TotemPole.java and Head.java to your class ftp directory. You can, of course, modify any of the other classes used in this program and resubmit their source code, but this is not required.

Part 2: Is the Die Class Fair?

Design and implement a program called DieCheck that creates a 6-sided Die object (using the Die class defined on page 204 of your text), and then rolls that object 100,000 times keeping a count of how often each possible face value occurs. The purpose of this program is to determine if the Die object is really "fair". When you roll a "fair" die, each face value is equally likely to occur. Your program should print the number of times that each face value occurs during the 100,000 rolls so that the user can see if the die is fair.

What to Turn In

Turn in the following source code files:

Remember that the files you turn in must have exactly these names. You were shown how to transfer files to your class ftp directory in lab 1, here is a quick refresher.