WAP to calculate the commission for salesman.


SALES                                             COMMISSION RATE
30001 onwards            -                         15%
22001-30000                -                        10%
12001-22000                -                         7%
5001-12000                  -                         3%

0-5000                           -                        0%


#include<iostream.h>
#include<conio.h>
void main()
{
  float sales,comm;
  clrscr();
  cout<<"Enter the sale:";
  cin>>sales;
    if(sales>5000)
      if(sales>12000)
if(sales>22000)
 if(sales>30000)
   comm=sales*0.15;
 else
   comm=sales*0.10;
else
 comm=sales*0.07;
      else
comm=sales*0.03;
    else
      comm=0;
  cout<<"\n"<<"The commission is:"<<comm<<"\n";
  getch();
}

Comments

Popular Posts