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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started