Question: Create a C++ code Write a C++ console program that prompts the user for what size of an array to create. Use dynamic memory allocation
Write a C++ console program that prompts the user for what size of an array to create. Use dynamic memory allocation to create an array of integers on the heap. Use a loop to gather numbers from the user and store them in the array. Use pointer notation to access the array. After the array has been filled, compute the average and the quantity of numbers that are above the average. Display the results in a pleasing format. Note: Do not use square bracket notation [ in this program, except for when using the new operator. Use only pointer notation to manipulate the array. Note: Whenever you use dynamically allocated memory, it is critical that you remember to de-allocate the memory so that it is returned back to the operating system. signment 21 How many integers do you want in the array? 5 hat is int 1: 1 hat is int 2: What is int 3: 2 hat is int 4:4 hat is int s3 Average of your ints: 3.00 Number of ints above average: 2 bove average ints are: lenent 1 is above average. It is: 5 lement 3 is above average. It is: 4 Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
