Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions 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

expand button
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education