Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The program is to get a list of numbers from the user and prints a report that shows the numbers followed by the total and
The program is to get a list of numbers from the user and prints a report that shows the numbers followed by the total and average. Complete the unfinished functions using pointers. You may need to read Chapter 9 on Pointers in the Gaddis textbook. Using the input: 7 45.25 49.38 12.75 123.5 8.25 19.95 145.7 The output should be exactly as follows: # Amount 0 w NP + in 45.25 49.38 12.75 123.50 8.25 19.95 145.70 404.78 57.83 6 Total Average #include #include using namespace std; #include #include using namespace std; void printReport(const double *, int); void tota LandAverage(const double *, int, double *, double *); int main() { 1/ Get count and numbers from user int count {0}; cin >> count; double *ptr = new double [count] {0.0}; for (int index = 0; index > ptr[index]; } printReport(ptr, count); delete [] ptr; return 0; } //* 1/* printReport: This funtion prints the given list of numbers and statistics. //* //* Parameters list - pointer to the first element in the list size - the number of elements in the list void printReport(const double *list, int size) { // Write your code here. } 1/* tota LandAverage: This function calculates the total and average of a given list of real numbers. The results are returned through output parameters. //* Parameters list - pointer to the first element in the list size - the number of elements in the list totPtr - (output) pointer to the caller's total variable avePtr - (output) pointer to the caller's average variable void tota lAndAverage(const double *list, int size, double *totPtr, double *avePtr) { // Write your code here. }
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