Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help me with creating the definitions for these functions in a C++ program C++ Function Name Purpose ReadSalesFromFile Reads sales data from the

Can someone help me with creating the definitions for these functions in a C++ program

image text in transcribed

image text in transcribed

C++ Function Name Purpose ReadSalesFromFile Reads sales data from the given filename and populates multiple arrays of data. THIS FUNCTION SHOULD NOT PRINT ANYTHING ON SCREEN. Only reads from the input file. Parameters(4): inputfilename, first name array, last name array, and sales array Return Type: void SalesReport Writes a sales report to a given output filename. The report should be formatted the same as the example report given below. You should use columns in the body of your report (setw). Inside this function it should call the FindMaxSaleslndex, FindMinSaleslndex, CalculateAvgSales, and CalculateTotalSales functions to get data to write in the report. THIS FUNCTION SHOULD NOT PRINT ANYTHING ON SCREEN. Only write to the output file. Parameters(5): outputfilename, first name array, last name array, sales array, number of element in array. Return Type: void FindMaxSaleslndex Searches the sales array for the maximum sales amount. It should return the index of the maximum sales. It should set the maximum sales reference parameter to the maximum sales in the array. This function should not print anything on screen. THIS FUNCTION SHOULD NOT PRINT ANYTHING ON SCREEN Parameters(3): sales array, number of element in array, maximum sales (pass by reference) Return Type: int FindMinSaleslndex Searches the sales array for the minimum sales amount. It should return the index of the minimum sales. It should set the minimum sales reference parameter to the minimum sales in the array. THIS FUNCTION SHOULD NOT PRINT ANYTHING ON SCREEN. Parameters(3): sales array, number of elements in array, minimum sales (pass by reference). Return Type: int CalculateAvgSales Calculates the average sales for the array. THIS FUNCTION SHOULD NOT PRINT ANYTHING ON SCREEN. Parameters(2): sales array, number of element in array Return Type: double CalculateTotalSales Calculates the total sales for the array. THIS FUNCTION SHOULD NOT PRINT ANYTHING ON SCREEN. Parameters(2): sales array, number of element in array Return Type: double

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

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

What aspects would it be impossible to capture?

Answered: 1 week ago

Question

Enhance your words with effective presentation aids

Answered: 1 week ago