Write a java program to accept monthly sales and print commission for
the salesman
Sales (Rs.) Commission
Upto Rs. 5000 nil
> Rs. 5000 and upto Rs. 10000 12%
> Rs. 10000 and upto Rs. 15000 15%
> Rs. 15000 18%
Apart from this, each salesman gets travelling allowance of Rs. 1500. Display
the total income of each salesman along with the sales.
Answers
import java.util.*;
public class a
{
public static void main(String args[])
{
Scanner sc = new Scanner (System.in);
System.out.println("Please Neter The Monthly Sales");
double income = sc.nextDouble();
if (income <= 5000)
{
System.out.println("Nil");
double ta = 1500.0 ;
double I = income + ta ;
System.out.println("Travelling Allowance = "+ta);
System.out.println("Income ="+I);
}
else if (income > 5000 && income < 10000)
{
System.out.println("12%");
double c = (income * 12)/100;
double ta = 1500.0 ;
double I = income + ta ;
System.out.println("Commission = "+c);
System.out.println("Travelling Allowance = "+ta);
System.out.println("Income ="+I);
}
else if (income > 10000 && income < 15000)
{
System.out.println("15%");
double c = (income * 15)/100;
double ta = 1500.0 ;
double I = income + ta ;
System.out.println("Commission = "+c);
System.out.println("Travelling Allowance = "+ta);
System.out.println("Income ="+I);
}
else if (income > 15000)
{
System.out.println("18%");
double c = (income * 18)/100;
double ta = 1500.0 ;
double I = income + ta ;
System.out.println("Commission = "+c);
System.out.println("Travelling Allowance = "+ta);
System.out.println("Income ="+I);
}
sc.close();
}
}