write a program in java to input the annual income of a person calculate the tax amount at the rate of 15% display income tax percentage and tax amount
Answers
Answered by
3
Answer:
//Importing Scanner class from java.util package...
import java.util.Scanner;
class Income{
public static void main (String[] args){
//Creating object for Scanner class...
Scanner sc=new Scanner (System.in);
//Accepting input...
System.out.print("Enter your annual income:\t");
double Inc=sc.nextDouble();
//Calculating tax...
double tax=0.15*Inc;
// Or you can do.. double tax=(15/100)*Inc;
double taxPercent = (tax/income)*100;
System.out.println("Tax:"+tax);
System.out.println("Tax%="+taxPercent);
}
}
Similar questions
Math,
4 days ago
Environmental Sciences,
4 days ago
Physics,
4 days ago
Accountancy,
9 months ago
Math,
9 months ago