![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 10.12.2021 01:00 chayaharroch03
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](/tpl/images/cats/User.png)
Answers: 3
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 21.06.2019 18:00
Ihave buncha points. does anyone want any?
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 12:40
Curriculum exam to process a resident's payment, you must click on onesite payments home page. from the a. reports b. my settings o c.transactions o d. rent tab
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 14:00
How are stop motion special effects in animated films created
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 17:30
Write pseudocode to represent the logic of a program that allows the user to enter a value. the program multiplies the value by 10 and outputs the result.
Answers: 1
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](/tpl/images/cats/fizika.png)
Physics, 20.11.2020 03:10
![question](/tpl/images/cats/en.png)
English, 20.11.2020 03:10
![question](/tpl/images/cats/istoriya.png)
History, 20.11.2020 03:10
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/istoriya.png)
History, 20.11.2020 03:10
![question](/tpl/images/cats/en.png)
English, 20.11.2020 03:10
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 20.11.2020 03:10
![question](/tpl/images/cats/mat.png)
Mathematics, 20.11.2020 03:10
![question](/tpl/images/cats/mat.png)
Mathematics, 20.11.2020 03:10
![question](/tpl/images/cats/mat.png)
Mathematics, 20.11.2020 03:10
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/en.png)
English, 20.11.2020 03:10
![question](/tpl/images/cats/ekonomika.png)
Business, 20.11.2020 03:10
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 20.11.2020 03:10
![question](/tpl/images/cats/fizika.png)
Physics, 20.11.2020 03:10
![question](/tpl/images/cats/istoriya.png)
History, 20.11.2020 03:10
![question](/tpl/images/cats/mat.png)
Mathematics, 20.11.2020 03:10