Question: USING C++/ THIS IS FOR COMPUTERSCINES 101 AND PLEASE USE RELEVANT CONCEPTS/ NOTHING TOO COMPLEX. THANK YOU!! Instructions: You have been tasked with writing a
USING C++/ THIS IS FOR COMPUTERSCINES 101 AND PLEASE USE RELEVANT CONCEPTS/ NOTHING TOO COMPLEX.
THANK YOU!!

Instructions: You have been tasked with writing a program to generate a quarterly sales report for your company. The data is in the "sales.txt" file (A zipped file under the Materials category in this week's module on Canvas). This file contains records similar to 2013-1003 The first field is the invoice number which is not used, the second is an equipment code and the third is the cost of the parts on that order. The equipment code will be A Capital Equipment B Expensed Equipment C Small Parts 120.00 Your program should read a line from the file into a struct, pass the struct and three accumulator variables to a function and then continue reading lines and calling the accumulator function until it reaches end of file. It should then call the writeReport function to write the report into a text file, inventoryReport.txt S A L E S R E P O R T Capital Equipment Expensed Equipment Small Parts $24093.18 $22222 " 80 $45251.98 26.31% 24 " 27% 49.42% Total Sales $91567.96 The prototype of the accumulator function will be similar to void accumulate (const SalesRecord &s, double & capSales, double &egpSales, double & prtsales) ; 1. Why did we pass the struct as a reference variable? 2. Why did we declare it as const? 3. Does it make sense to do both? Explain why it does or does not
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
