//https://csprograms4u.blogspot.com/
//Chapter 2
//Program 4
//if else if ladder
import java.util.Scanner;
public class ifelseifladder
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
double sales,comm;
System.out.println("Enter Sales in Rs");
sales=sc.nextInt();
if(sales<5000)
{
comm=0;
}
else if(sales<10000)
{
comm=sales*0.05;
}
else if(sales<20000)
{
comm=sales*0.1;
}
else if(sales<30000)
{
comm=sales*0.12;
}
else
{
comm=sales*0.15;
}
System.out.println("Commission is="+comm);
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.