oking professional report (an example of the professional report is in the picture attached) that includes: A) Headings B) One line for each salesperson; each line includes a line number, salespersons names, gross sales, and calculated sales commission C) total line with a total of the gross sales and the commissions. #5) CODE REQUIREMENTS: Code to open the file
Instructions from my Introduction to
#1) Write code in C++ to read a file and produce on the console a "Monthly Sales Report."
#2) Open a file called Sales_2020_08.txt. Using the following:
#include <iostream>
#include <fstream>
int main()
{
ifstream myInFileStream ();
myInFileStream.open ("Sales_2020_08.txt");
#3) Read each record that has variables such as FirstName, LastName, SalesAmount, and etc.
#4) Produce a nice looking professional report (an example of the professional report is in the picture attached) that includes:
A) Headings
B) One line for each salesperson; each line includes a line number, salespersons names, gross sales, and calculated sales commission
C) total line with a total of the gross sales and the commissions.
#5) CODE REQUIREMENTS:
- Code to open the file
- a loop that stops on EOF or other
mechanisms. - a line counter for each line.
- Commission rates are based on gross sales amount:
- 5.5% for sales in the range of 0 - 10000.00
- 6.7% for sales in the range of 10000.01 - 22500.00
- 11.2% for sales greater than 22500.00
#6) DO NOT DO THE FOLLOWING:
A) Do not manually count the number of records and put the reading of the records in a for loop or while loop with the number of records controlling the loop.
B) There are no user inputs so do not manually code any of the data. Once the program executes, we are simply just reading the date from the file.
#7) The attached photo is an example of how your file must output when executed
Step by step
Solved in 3 steps with 2 images