Question: Pointer Create a C++ console application to store points for contestants in a contest. Ask the user for the number of contestants. Create two parallel

Pointer

Create a C++ console application to store points for contestants in a contest. Ask the user for the number of contestants. Create two parallel dynamic arrays, one to store the names and one to store integer scores from zero to 100. Do not accept out of range numbers. Ask the user for each name and the score one at a time.

When you encounter the end of the array, print all names and scores. Also, print the average and indicate whether each score is above or below average.

Example:

Requirements:

1) Add comments as you code. Do NOT wait until you are done coding. Also, in the beginning of your codes include the following comments:

a. Purpose of the program b. Name of the author c. Date

2) Tell the user what the program is all about.

3) Create a function to get the values from the user and store them in the arrays. Pass

the pointers and array size to the function. This function will have a void return type.

4) Create a function to calculate the average. Pass a pointer and the size to the array. The

function should return the average.

5) Create another function to print the result. Pass the pointers, the array size, and the

average to the function.

6) Do not pass arrays to functions. Even though it is possible to do so, we are trying to

practice using pointers.

7) All functions will be called only by the main. Prevent calling them by other functions.

8) No global variables are allowed.

9) Delete the arrays to free the memory after printing the results. 10)Ask the user if they want to continue. If so, ask the questions again.

Hints:

This is how you create a dynamic array: arrayPtr = new int[size]; Use this syntax to pass the pointer to a function: void display (string* namePtr){ }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!