Homework 7, Random Number Tester.

Short Description:

Write a program that will test the random number generator for various sizes of dice.

Goals

When you finish this homework, you should have:

Formal Description

Write an interactive program that will test my random number package for use as a die simulator. Your program should ask the user for a number of sides (s) , between 2 and 100. It should then ask for a number of trials (t), between 10 and 1000. It should then

Your program should print reduced fractions. (this is really just a requirement to get you to implement Euclid's GCD algorithm.)

You will only be given positive integer input, but you should check to see that all values given are in range. Print an error message and repeat the question if the values are not in range.

An example run:

How many sided die do you wish to emulate? (2 - 100) : 4
How many trials do you wish to perform ( 10 - 1000): 4000
Error: 4000 is too many trials.
How many trials do you wish to perform ( 10 - 1000): 100

Conducting 100 trials. 

The results are:
Side      Outcomes      Fraction
1           20           1/5
2           25           1/4
3           27           27/100
4           28           7/25

What side do you wish to see again?  (0 - 4, 0 to exit): 3
3           27           27/100
What side do you wish to see again?  (0 - 4, 0 to exit): 0

Required Files

A tar or zip file containing all source code to build the program. This includes a Makefile to assemble your code.

Submission

Submit the assignment to the D2L folder 7 by the due date.