Using the following chart
Sales
Commission
ratio
10%
15%
Less than 10000$
Greater than or equal
10000$ and less than
15000$
Greater than or equal 15000$
20%
Commission = sale * commission ratio
Sample Run:
enter the amount of your sales:
your commission is 1912.5
#include <iostream>
using namespace std;
int main(){
double sale,commissionRatio;
cout<<"enter the amount of your sales: ";
cin>>sale;
if(sale<10000){
commissionRatio=0.1;
}else if(sale>10000 && sale<15000){
commissionRatio=0.15;
}else{
commissionRatio=0.2;
}
double commission = sale * commissionRatio;
cout<<"your commission is "<<commission<<"\n\n";
system("pause");
return 0;
}
Comments
Leave a comment