Write a program to calculate the commission for the salesmen. the commission is calculated as follows: Sales made Commission Rate 30001 onwards 15% 22001 to 30000 10% 12001 to 22000 5% 0 to 12000 0%
Answers
Answered by
0
/*To calculate commission for a salesman. The commission is calculated according to the flg rates:
30001 onwards: 15%
22001-30000: 10%
12001-22000: 7%
5001 -12000: 3%
00000-5000: 0%*/
#include<iostream>
using namespace std;
int main()
{
double sales,comm;
cout<<“Enter the sales made by the salesman:\n”;
cin>>sales;
if((sales>=0)&&(sales<=5000))
comm=0;
if((sales>5000)&&(sales<12000))
comm=sales*0.03;
if((sales>12000)&&(sales<22000))
comm=sales*0.07;
if((sales>22000)&&(sales<30000))
comm=sales*0.10;
if(sales>30000)
comm=sales*0.15;
cout<<“\nThe commission is: “<<comm<<“\n”;
return 0;
}
Similar questions