{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

requirements - short frequencyArraySize*Calculates the...

Info icon This 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 [],
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern