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, 22.06.2019 20:10
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a.if the manual switch s is on, then the light l is on. b.besides the manual switch, there is a motion detector, m1, which activatesthis light.c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d.the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
question
Computers and Technology, 23.06.2019 13:10
What is domain name system (dns)? allows dynamic ip address allocation so users do not have to have a preconfigured ip address to use the network converts ip addresses into domains, or identifying labels that use a variety of recognizable naming conventions the efficient coexistence of telephone, video, and data communication within a single network, offering convenience and flexibility not possible with separate infrastructures the integration of communication channels into a single service
Answers: 2
question
Computers and Technology, 24.06.2019 07:20
Ingrid started speaking about her slide presentation. when she clicked to th"third slide, which had just a picture of an elephant, she forgot what she wassupposed to talk about. what could ingrid do to avoid this situation in thefuture? oa. print handouts for her audience.ob. add presenter's notes to each slide.oc. add a video to each slide.od. save her slide presentation to a flash drive
Answers: 2
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, 17.08.2020 01:01
Questions on the website: 13722367