Question: 2. Write a testing program in main,cpp that calculates the average of a set of numbers, such as: Prompt the user to enter the number

2. Write a testing program in main,cpp that calculates the average of a set of numbers, such as: Prompt the user to enter the number of values to be calculated Create a new dynamic array of that size, called dArray Repeatedly prompt the user to enter values until the array is full show the values in dArray continue to add more values to dArray (that should let the dArray become a new double sized array) a. create a new double sized dArray; b. use a temporary array to keep all the item values; C. move the items from temp array to the new double sized dArray; d. delete the temp array, set its pointer to nullptr; e. add the additional items that exceeded original size; Calculate the sum and the average of the values in the double sized dArray Show the values in the new double sized dArray End the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
