> I have to make a program that generates the numbers 1- 10 randomly 500 times. Then we have to display the results using

I have to make a program that generates the numbers 1- 10 randomly 500 times. Then we have to display the results using

Posted at: 2014-12-18 
#include

#include

#include

using namespace std;

const int MAX_INT = 10;

const int TRIALS = 500;

void initializeFrequencies (int [], const int);

void generateFrequencies (int [], const int);

void displayFrequencyHistogram (const int [], const int);

int main() {

int frequency [MAX_INT];

srand (time (NULL));

initializeFrequencies (frequency, MAX_INT);

generateFrequencies (frequency, TRIALS);

displayFrequencyHistogram (frequency, MAX_INT);

return 0;

}

void initializeFrequencies (int frequency [], const int length) {

for (int i=0; i
}

void generateFrequencies (int frequency [], const int trials) {

for (int i=0; i
}

void displayFrequencyHistogram (const int frequency [], const int length) {

for (int i=0; i
cout << (i+1) <<": ";

cout << frequency [i] << endl;

}

}

We have to use the 3 fcns here is what i have so far.

#include

using namespace std;

const int Max_int = 11;

const int length = 500;

void initializeFrequencies(int frequency[], const int length);

void generateFrequencies(int frequency[]);

void displayFrequencyHistogram(const int frequency[],const int length);

int main() {

int frequency[length];



initializeFrequencies(frequency, length);





generateFrequencies(frequency);





displayFrequencyHistogram(frequency, length);











return 0;

}

void initializeFrequencies(int frequency[], const int length){



int frequency[length]= {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};



}

void generateFrequencies(int frequency[]){







}

void displayFrequencyHistogram(const int frequency[],const int length){



int i=1;



for (i=1; i<=Max_int; i++ ){

cout<< i<<": " <
}

}

output should look like this. Please help!

1: *******

2: *******

3: *********

4: **************

5: *********

6: ***********

7: ********

8: ***********

9: ************

10: ************

Program ended with exit code: 0