I would really appreciate if someone helps me out with this C++ assignment; REQU
ID: 3910116 • Letter: I
Question
I would really appreciate if someone helps me out with this C++ assignment;
REQUIREMENT STATEMENT A company Kitchen Products produces some good products for the kitchen. There are many students working for this company as Sale Representatives. The Sale Representative is hired to look for customers then set appointments to advertise the products to sale. Provide the application that helps the company Kitchen Products to calculate the salary of Sale Representatives at the end of each month The application will display the message to ask users some input: name of Sale Representative, employee id, number of appointments made, sale amount then print out the salary split as below:
The salary will be calculated as follows:
First, calculate two amounts salary1 and salary2 1.
Salary1 = $18 * the number of appointments with customers 2.
Salary2 = based on the sum of commission and bonus that the Sale Representative made in a month. The commission and bonus are calculated as below table
Commision Bonus Each appointment with individual customer to advertise the products with no sale in the month 0 0 With sale less than or equal $12000 in the month 8% on the sale 0 With sale is greater than $12000 but less than 20000 in month 8% on the sale 2% on any sale beyond $12000 With sale is equal or greater than $20000 in a month 4% On any sale beyond $12000 Then the salary of the Sale Representative will be the greater amount between salary1 and salary2Explanation / Answer
#include <iostream>
using namespace std;
int main() {
string name;
int empID,appointments;
double saleAmount,salary1,salary2,salary,commission,bonus;
cout<<"Enter the name of Sale Representative : ";
cin>>name;
cout<<" Enter employee id : ";
cin>>empID;
cout<<" Enter the number of appointments made : ";
cin>>appointments;
cout<<" Enter the sale amount : ";
cin>>saleAmount;
salary1 = 18 * appointments;
if(saleAmount == 0)
{
commission = 0;
bonus = 0;
}
else if(saleAmount <= 12000)
{
commission = 0.08*saleAmount;
bonus = 0;
}
else if(saleAmount > 12000 && saleAmount < 20000)
{
commission = 0.08*saleAmount;
bonus = 0.02*(saleAmount-12000);
}
else if(saleAmount >= 20000)
{
commission = 0;
bonus = 0.04*(saleAmount-12000);
}
salary2 = commission+bonus;
salary = (salary1>salary2)?salary1:salary2;// greater of salary1 and salary 2 will be the salary
cout<<" Name of sales representative : "<<name;
cout<<" Name of employee id representative : "<<empID;
cout<<" The salary of the sales respresentative :$"<<salary;
return 0;
}
Output:
Enter the name of Sale Representative :John
Enter employee id :1007
Enter the number of appointments made :50
Enter the sale amount :12067
Name of sales representative : John
Name of employee id representative : 1007
The salary of the sales respresentative : $966.7
Do ask if any doubt. Please upvote.