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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Instructions from my Introduction to Programming C++ Professor:

#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

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education