### Help finishing program!

I have to finish a program with the following directions. The questions marks are where code needs to be entered and I can't get it.

Read, understand, and then finish the following program. Test the program by creating 20 random numbers between 1 and 7, and creating 10 characters. The questions marks (?) in the program are the ones you need to write code to replace them.

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112`` ``````#include #include #include using namespace std; void bubblesort( int [], int ); void bubblesort( ?, ? ); // function overloading to sort characters void print(int[], int); void printH(int[], int); void print(?,?); // function overloading to print characters void printH(?,?); // function overloading to print histogram for characters int main() { int i, magic, size; int high; int low ; ? // declare an integer array named a with size 100 ? // declare a character array named b with size 100 cout << "how many random numbers do you want to create? (no more than 100)\n"; ? // read user input into variable size if (size > 100) { cout << "too many, program ends.\n"; return -1; } cout <<"enter the smallest and largest random number you want to create:\n"; ? // read user input into variables low and high srand(time(NULL)); ? //write a for loop to run the code inside { }. The total loops = size. { magic = rand() % (high-low+1) + low; a[i] = magic; srand(time(NULL)+i*i+3); } cout << "\nthe random numbers generated are: \n"; ? //write a statement to call print function to print a bubblesort (a, size); cout << "\nthe random numbers after sort:\n"; ? //write a statement to call print function to print a cout << "\nthe histogram of the numbers:\n"; printH(a,size); cout << "\n\nhow many random lower case characters do you want to create? (no more than 100)\n"; cin >> size; if (size > 100) { cout << "too many, program ends.\n"; return -1; } high = 122; low = 97; srand(time(NULL)); for (i = 0; i < size; i++) { magic = rand() % (high-low+1) + low; b[i] = magic; srand(time(NULL)+i*i+3); } cout << "\nthe characters generated are: \n"; print(b, size); bubblesort (b, size); cout << "\nthe characters after sort are: \n"; print(b, size); cout << "\nthe histogram of the charaters:\n"; printH(b,size); return 0; } void bubblesort( int x[], int len ) { ? //write function definition to bubble sort the integer array x[], len is the size of x[] } void bubblesort(?,? ) { ? //write function definition to bubble sort a character array } void print (int a[], int len) { ? //write function definition to print an integer array } void printH (int a[], int len) { //function definition to print histogram of a sorted integer array int current, shows; current = -1; shows = 0; for (int i = 0; i < len; i++) { if (current != a[i] ) { current = a[i]; cout << "\n" << a[i] << " *"; } else cout << "*"; } cout << endl; } void print (?,?) { ? //write function definition to print a character array } void printH (?,?) { ? //write function definition to print histogram of a sorted character array }``````
To make an array simply type int VarName[SizeOfVariable];
To display cout << "Johnny is " << VarName[NumInsideSizeRange] << "years old" << endl;
Topic archived. No new replies allowed.