Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ console application for the following lab: Sales Program Variables: An array of double to hold each months sales. Methods: Average - Calculates

Write a C++ console application for the following lab: Sales Program Variables: An array of double to hold each months sales. Methods: Average - Calculates the average sales for the year. Pass in an array of type double. Create a program called Sales. The program should contain an array that stores monthly sales figures. . Method ShowReport: Add a method called ShowReport() that will print a report. Takes an array of double as a parameter. The report should show a detail line for each month. It should also show the average sales for the year and the total sales for the year. For example:

Jan 100.00 Feb 130.00 Dec 120.00 Avg 105.00 Total 1300.00 Note: Use a loop to print the data. 2. Method ShowReportToFile: Takes an array of double AND a filename as parameters. The method should print the exact same data as the ShowReport method does but write it to a file instead the name of the file to write to should be passed in as a parameter. The ShowReportToFile method should have the following signature: void ShowReportToFile (double sales[], string name) THEN:

Modify that it shows the following menu: Sales Program ----------------- 1. Print report to console 2. Print report to file 3. Exit Enter Choice: Take the appropriate action when the user makes a choice. For example, if the user enters a 1 then the program should show the report on standard output. Once the report is printed (to the console or a file) the program should redisplay the menu and allow the user to enter another choice. The program should only end when the user types in a 3.

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

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

Discuss the current trends in mobile marketing.

Answered: 1 week ago

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago