jeudi 17 septembre 2020

Create a program for calculating the income tax to be paid by an individual earning less than 1 crore. Use conditional statements only [closed]

I am having hard time figuring out its solution and how do I go about it. Help me find the solution to it.

Use the following rules: Rules table figure

Additional information:

The basic exemption limit for individuals (i.e. below 60 years of age) is Rs. 2.50 lakhs. The basic exemption limit for senior citizens (60 years to 80 years) is Rs. 3.00 lakhs.

The basic exemption limit for very senior citizens (80 years and above) is Rs. 5.00 lakhs.

No extra cess is to be levied.

Take the income and age as inputs and return the income tax.

For example, if the income of an individual is 6 lacs and his/her age is < 60, then the income tax to be paid is calculated by the following set of rules:

Example figure

import java.util.Scanner;

class Source {

public static void main(String args[]) {
     Scanner scan = new Scanner(System.in);
    // Enter annual income
    double income = scan.nextDouble();
    // Enter age
    int age = scan.nextInt();
    
    double tax = 0.0;
    
    // Write your logic here
    
    System.out.print(tax);
    scan.close();
}

}

Aucun commentaire:

Enregistrer un commentaire