subject

In C++ please. A company has sales reps that sell two different product lines. The sales amounts for each product are recorded. A commission is paid based on the total sales. The commission is determined as follows:

Total sales Commission

less than $4000 5% of sales

$4000 to less than $8000 7% of sales

$8000 or more 10% of sales

Data for sales reps is stored in a file salesdata. txt. Each line of the file is in this format:

Salesrep name#sales1 sales2

Create a struct to represent a SalesRep with

-Name

-Product1 sales

-Product 2 sales

-Total sales

-Commission

Create an array of type SalesRep in main that can hold up to 20 reps.

Your program will prompt for the name of the file and validate that it exists. Read the data from the file and populate the array. You will need to count the actual number of sales reps in the file. Make sure your code tests that the array is not overfilled.

Create and generate two reports to an output file called reports. txt:

Sales report Print the name, total sales, and commission for all reps entered into the system in the format shown below on sample output. Also calculate and print the total sales and commission of all reps.

Diamond Club Print the name and total sales of all reps with $10000 or more in total sales

Run your program with this file

James T. Kirk#8500 2650
Bruce Wayne#4880 3120
Harry Potter#1500 850
Peter Parker#9800 5100
Clark Kent#2750 1250
Lois Lane#8250 5200
Bob Blue#5125 7500
Steve Green#1200 3000
Jill White#1500 2500
Sam Black#5200 2800

For FULL credit you should create functions to:

-Read the file

-Calculate the commission for an individual

-Generate the sales report

-Generate the diamond club report

It is better to have working functionality WITHOUT functions than to run out of time … (you will lose 10% of the grade).

If you cannot use structures correctly, this program can be done by reading the file twice to generate each report. You will lose 10% of the grade for this option.

For full credit:

you MUST include comments that document the problem solving process

your code must be properly indented

your code will have functions

output should be formatted so that numbers align as in sample output

Make sure the answers are correct! I am purposely not showing the answers

SAMPLE RUN

Enter name of file: s. txt
s. txt not found, re-enter: sales. txt
Reading file
X records read

Report generated
Programmed by yournme

(in reports. txt)
Sales Report

Employee Total Sales Commission
Captain Kirk $ .xx $ .xx
Bruce Wayne $ .xx $ .xx
Harry Potter $ .xx $ .xx
Peter Parker $ .xx $ .xx
Clark Kent $ .xx $ .xx

Total $ .xx $ .xx

Diamond Club Qualified

Name Total Sales
rep $ .xx

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 05:00
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
question
Computers and Technology, 23.06.2019 09:00
Which company provides a crowdsourcing platform for corporate research and development? a: mtruk b: wiki answers c: mediawiki d: innocentive
Answers: 2
question
Computers and Technology, 23.06.2019 10:30
Would a ps4 wired controller work on an xbox one
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Open this link after reading about ana's situation. complete each sentence using the drop-downs. ana would need a minimum of ato work as a translator. according to job outlook information, the number of jobs for translators willin the future.
Answers: 3
You know the right answer?
In C++ please. A company has sales reps that sell two different product lines. The sales amounts f...
Questions
question
Mathematics, 05.05.2020 16:29
question
Mathematics, 05.05.2020 16:29
question
History, 05.05.2020 16:29
question
Mathematics, 05.05.2020 16:29
Questions on the website: 13722359