हिंदी

Input the income, compute the tax according to the given conditions and display it. Taxable Income Does not exceed ₹160000 > 160000 and <=500000 > 500000 and <= 800000 >=80000

Advertisements
Advertisements

प्रश्न

Input the income, compute the tax according to the given conditions and display it.

Taxable Income Tax
Does not exceed ₹160000 Nil
> 160000 and <=500000 (TI – 160000) x 10%
> 500000 and <= 800000 (TI – 500000) x 20% + 34000
>=80000 (TI – 800000) x 30% + 94000
कोड लेखन
Advertisements

उत्तर

 import java.util.*;  //imports all the classes of the utility package
class clTax
{
   void main()
   {
       Scanner sc = new Scanner(System.in);
       long TI = 0;
       double tax = 0.0;
       System.out.print("Enter Income :: ");
       TI = sc.nextLong();
       if(TI < 160000) //calculating the tax value
       {
         tax = 0.0;
       }
       else if(TI <=500000)
       {
         tax = (TI - 160000) * 10.0/100;
       }
       else if (TI<= 800000)
       {
         tax = (TI -– 500000) * 20.0/100 + 34000;
       }
       else
       {
         tax = (TI -– 800000) * 30.0/100 +94000;
       }
       System.out.println(" For Income: " + TI + “ Tax: " + tax);
   }
}

Output:

Enter Income :

1000000 For Income : 1000000 Tax : 154000.0

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 11: Programs Overall - Conditions [पृष्ठ २५०]

APPEARS IN

रुपा पंडित Computer Applications [English] Class 10 ICSE
अध्याय 11 Programs Overall
Conditions | Q 1. | पृष्ठ २५०
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×