Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Define an int const named NUM_EXPENSES and set it to 7. 2. Define an array named expenses of seven double values with these initial

1. Define an int const named NUM_EXPENSES and set it to 7.

2. Define an array named expenses of seven double values with these initial values: 45.25, 49.38, 12.75, 123.50, 8.25, 19.95 and 145.70.

3. Define and initialize a pointer named ptr that can point to a double.

4. Iterate through the array using ptr to calculate the total and average of the expenses.

5. Reporting. Write a block of code to print a report. The block of code should print the report header first. Then use the pointer variable to iterate through the expenses array to print the expenses. Finally print the total and the average. The output should look exactly as follows (single space).

 # Amount ---------------------- 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions

Question

What does stickiest refer to in regard to social media

Answered: 1 week ago

Question

8. Do the organizations fringe benefits reflect diversity?

Answered: 1 week ago

Question

7. Do the organizations social activities reflect diversity?

Answered: 1 week ago