requirements

requirements - short frequencyArraySize ); /*Calculates the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC 3390 ASSIGNMENT 1 Due 9.23.2002 (Midnight) Requirements : Write a C++ program that calculates the frequency of the results from throws of two dice. Store the results of 1000 such throws in an array. Then pass the array to a subroutine that counts the frequency of each of the possible results. Finally, print a frequency histogram; and also output the least (and most) frequently occurring result (in the case of a tie, the smaller result prevails). Print one asterisk for every 10 occurrences. The following functions are mandatory (given in C syntax: convert to C++): void GenerateIntegers ( short intArray [], short size ); /* Generates size integers in the range 2. .12 and stores them in intArray*/ void CalculateFrequency ( short intArray [], short intArraySize, short frequencyArray [],
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: short frequencyArraySize ); /*Calculates the frequency of each of the integers 2. .12 in intArray and stores results in frequencyArray*/ void FindExtremeValues ( short arr , short arrSize, short* leastFreqValue, short* mostFreqValue ); /*Finds the least frequent and most frequent values in arr*/ void PrintHistogram ( char* outFileName, short arr , short arrSize ); /*Prints a histogram of the elements of arr into file outFileName*/ In particular, use the C++ I/O system (cin, cout, and associated methods), reference parameters, const in place of # define , suitable inline functions, and a judicious use of both /*. ..*/ and //. .. comments. Grading : • Source code 25% • Compilation, execution, output 75%...
View Full Document

This note was uploaded on 01/17/2012 for the course CSC 1254 taught by Professor Blanks,l during the Fall '08 term at LSU.

Ask a homework question - tutors are online