Question: Write a C++ program that asks the user to input an integer named numDoubles. Create a dynamic array that can store numDoubles doubles and make

Write a C++ program that asks the user to input an integer named numDoubles. Create a dynamic array that can store numDoubles doubles and make a loop that allows the user to enter a double into each array entry. Loop through the array, calculate the average, and output it. You may use smart pointers in your solution. If you do not use smart pointers, delete the memory allocated to the array before exiting.

Write the code for a C++ function that takes a pointer to an integer as parameter and adds 3 to the integer referenced by the parameter. The header for the function is as follows:

 void addThree(int *ptr) 

Add code to the main function to do the following. Define an int variable and give it a value, call addThree, and output the variable. It should be incremented by 3.

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!