Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package nbr;
- import java.util.Scanner;
- public class ComputeTax {
- public double tax;
- public int status;
- public void category()
- {
- System.out.println("category1: \n");
- System.out.println("1. Doctors: \n");
- System.out.println("2. Engineers: \n");
- System.out.println("3. Teachers: \n");
- System.out.println("4. Business Men: \n");
- System.out.println("category2: \n");
- System.out.println("5. service holders: \n");
- System.out.println("category3: \n");
- System.out.println("6.Workers: \n");
- }
- public double taxCalculator(int status,double income)
- {
- this.status=status;
- double a;
- if(income<=3000000)
- {
- System.out.println("No tax");
- }
- else if(income>3000000 && income<=8000000)
- {
- a =(income*0.03);
- tax=a;
- }
- else if(income>8000000)
- {
- a=(income*0.15);
- tax=a;
- }
- return 0;
- }
- public void display()
- {
- if(status==1){
- System.out.println("Status : Doctor");
- }
- else if(status==2){
- System.out.println("Status : Engineers");
- }
- else if(status==3){
- System.out.println("Status : Teachers");
- }
- else if(status==4){
- System.out.println("Status : Business Men");
- }
- else if(status==5){
- System.out.println("Status : service holders");
- }
- else if(status==6){
- System.out.println("Status : Workers");
- }
- else
- {
- System.out.println("Status not found");
- }
- System.out.println("pay tex : "+tax+"tk");
- }
- public static void main(String[] args)
- {
- Scanner Input=new Scanner(System.in);
- ComputeTax obj=new ComputeTax();
- obj.category();
- System.out.println("press any option:");
- int x=Input.nextInt();
- System.out.println("Input income");
- double y=Input.nextDouble();
- obj.taxCalculator(x,y);
- obj.display();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment