import java.io.*;
class employee
{
int pan;
String name;
double taxincome;
double tax;
void input(int p1,String n1,double ti)
{
pan =p1;
name=n1;
taxincome=ti;
}
void calc()
{
if(taxincome>250000)
tax=250000=(taxincome-250000)*0.3;
else if(taxincome>150000)
tax=5000+(taxincome-150000)*0.2;
else if(taxincome>100000)
tax=(taxincome-100000)*0.1;
else
tax=0;
}
void display()
{
System.out.println("Pan Number Name Tax-income Tax");
System.out.println("===================================================");
System.out.println(+pan+" "+name+" "+taxincome+" "+tax);
}
}
class result
{
public static void main (String[] args)throws IOException
{
employee ob = new employee();
int p;
String n;
double ti;
InputStreamReader reader = new InputStreamReader(System.in);
BufferedReader input = new BufferedReader(reader);
System.out.println("Enter Pan : ");
String c1 = input.readLine();
p= Integer.parseInt(c1);
System.out.println("Enter Name :");
n=input.readLine();
System.out.println("Enter income :");
String c2 = input.readLine();
ti= Double.parseDouble(c2);
ob.input(p,n,ti);
ob.calc();
ob.display();
}
}
help something is wrong
blackpinf4ever:
Anneyonghaseyo
Answers
Answered by
10
Hey mate I am suggesting you an app in which you can make any program related to java , html ,cccs etc.
SOLOLEARN APP
SOLOLEARN APP
Answered by
2
the 1st if condition is wrong
it should be:
tax=250000;
tax=(taxincome-2500)*0.3
Similar questions