Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using c++ , Define a function named expenseReport. Use pointer notation instead

ID: 3689947 • Letter: U

Question

Using c++ , Define a function named expenseReport. Use pointer notation
instead of array notation
in the implementation of the function.


The function declaration is as follows:

//*********************************************************************************************
// Function Name: expenseReport
//
// The function computes the average of the expenses stored in the input
// array parameter and displays a report of the expenses to the screen.
//
// Parameters:
//     expenses - An array of double numbers
//     count - An integer representing the number of expenses
// Returns:
//     void
//*********************************************************************************************

Write a complete program to use this function. You need to use an
array of double numbers and initialize the array with the expense amounts.
The report should have all numbers aligned on the decimal points.

The report should look exactly as follows:

                   My Expense Report
              =====================
                        1             45.25
                        2             49.38
                        3             12.75
                        4           123.50
                        5               8.25
                        6             19.95
                        7           145.70
Total           404.78
Average    57.83

Program template is as follows :

#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

int foo (int *ptr, int size);

int main() {

    return 0;
}

//*********************************************************************************
//* foo
//*
//* This function . . .
//*
//* Parameters:
//*    ptr - describe the purpose of this parameter
//*    size - describe the purpose of this parameter
//*
//* Returns:
//*
//*    Describe the return value
//*
//*********************************************************************************

int foo (int *ptr, int size) {
    // Write you code here . . .
    return 0;
}

/*
Copy output of this program below this line.
--------------------------------------------

*/

Explanation / Answer

#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

int foo (int *ptr, int size);

int main()

{

    return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote