Computer Science, asked by idki38016, 19 days ago

Write a program in Java to input monthly income to calculate and print Net Tax as per the

following formula:

Net tax = Annual Income Tax + Health and Education Cess.​

Attachments:

Answers

Answered by mpd20700
0

Answer:

import java.util.*;

class Tax

{

   public static void main (String[]args)

   {

       Scanner sc=new Scanner (System.in);

       System.out.println("Enter the Annual Income");

       int income=sc.nextInt();

       double tax1=0;

       double tax2=0;

       double net_tax=0;

       if(income<=250000)

       {

           tax1=0;

           tax2=0;

       }

       else if(income>250000 && income<=500000)

       {

           tax1=(5.0*income)/100;

           tax2=(4.0*income)/100;

       }

       else if(income>500000 && income<=1000000)

       {

           tax1=(20.0*income)/100+12500;

           tax2=(4.0*income)/100;            

       }

       else

       {

           tax1=(30.0*income)/100+112500;

           tax2=(4.0*income)/100;

       }

       net_tax=tax1+tax2;

       System.out.println("Net tax:"+net_tax);

   }

}

Similar questions