Write a C program to calculate and display the monthly income of a salesperson corresponding to the value of monthly sales input in the scanf ( ) function, let us consider the following commission schedule: (Note: use if-else statement)
Monthly Sales Income: -
Greater than or equal to Rs.50,000 375 plus 16% of sales
Less than Rs. 50,000 but Greater than or equal to Rs. 40,000 350 plus 14% of sales
Less than Rs. 40,000 but Greater than or equal to Rs. 30,000 325 plus 12% of sales
Less than Rs. 30,000 but Greater than or equal to Rs. 20,000 300 plus 9% of sales
Less than Rs. 20,000 but Greater than or equal to Rs. 10,000 250 plus 5% of sales
Less than Rs. 10,000 200 plus 3% of sales
#include <stdio.h>
#include <conio.h>
void main ( )
{
float sales, commission;
clrscr ( );
printf ("\n Enter the monthly sales..:"); scanf ("%f",&sales);
if ( sales >= 50000 )
{
commission = 375 + ( sales * 16 / 100 );
}
else if ( sales >= 40000 )
{
commission = 350 + ( sales * 14 / 100 );
}
else if ( sales >= 30000 )
{
commission = 325 + ( sales * 12 / 100 );
}
else if ( sales >= 20000 )
{
commission = 300 + ( sales * 9 / 100 );
}
else if ( sales >= 10000 )
{
commission + 250 + ( sales * 5 / 100 );
}
else
{
commission=200+(sales*3/100);
}
printf ("\n Monthly income of the salesperson is Rs.%.2f",commission);
getch ( );
}
Click here to contact us
No comments:
Post a Comment