hey guys this is what i have to do, I already got the first part, but I kind of nieed help to make it in three speprate functions, the follwoinf is what i have to do and then what I have already coded. I have coded just for one person, but I need more. if any1 can help, would be appreciated
This is my school assignment, pls if any1 can help, would be appreciated
The Rinky Dooflingy Company has a product line that includes five items. These
items sell for $100 (item number 1), $75 (item number 2), $120 (item number 3),
$150 (item number 4), and $35 (item number 5). There are four salespersons
working for this company, and the following table gives the sales report for a
typical week:
Salesperson Item
Number 1 2 3 4 5
1 10 4 5 6 7
2 7 0 12 1 3
3 4 9 5 0 8
4 3 2 1 5 6
Write a program to:
(a) Input the number of each item sold by a salesperson and compute his/her
total dollar sales using the data input. The numbers above are only for illustration.
(b) Compute the total income for each salesperson for the week. Income consists
of a total sales commission of 10% for each salesperson along with a fixed salary
of $200 per week.
(c) Display the sales data, total dollar sales, commission amount and total income
for each salesperson in a pleasing and appropriate format. All dollar amounts
should display with 2 decimal points and DO NOT rip off the salesman by only
using whole dollar amounts.
Write separate functions to perform items a, b, and c with parameter passing and
calls from the driver module. Do not use global variables. If you are familiar with
arrays you may use them if you want.
#include <iostream>
#include <iomanip>
using namespace std;
int salesperson1(int item1, int item2, int item3, int item4, int item5)
{
int item, total;
cout<<"How many times was item 1 sold by salesperson1: ";
cin>>item1;
cout<<"How many times was item 2 sold by salesperson1: ";
cin>>item2;
cout<<"How many times was item 3 sold by salesperson1: ";
cin>>item3;
cout<<"How many times was item 4 sold by salesperson1: ";
cin>>item4;
cout<<"How many times was item 5 sold by salesperson1: ";
cin>>item5;
cout<<"\n";
total=(item1*100)+(item2*75)+(item3*120)+(item4*15 0)+(item5*35);
return total;
}
int main()
{
float subtotal, moneyearned;
subtotal=salesperson1(100,75,120,150,35);
moneyearned=(subtotal/100)+200;
cout<<setprecision(2)<<showpoint<<fixed<<endl;
cout<<"Salesperson one, sold: $ "<<subtotal<<" on all 5 items"<<endl;
cout<<"Salesperson one made total of: $"<<moneyearned<<" per week\n";
system ("pause");
return 0;
}