Computer Science, asked by blackpinf4ever, 1 year ago

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
blackpinf4ever: Thanks
umikarao: Anneyonghaseyo........rm is looking cuteeeeeeee
umikarao: Welcome
umikarao: Btw whats ur name
blackpinf4ever: Hey! I'm PoorVi. ...what's ur name?
umikarao: Im umika
umikarao: How r u poorvi
blackpinf4ever: I'm feeling just fine fine fine
blackpinf4ever: Btw do u have twitter?

Answers

Answered by ruchi0823
10
Hey mate I am suggesting you an app in which you can make any program related to java , html ,cccs etc.
SOLOLEARN APP

Bphariharan: I'm in class 12
Bphariharan: phy :55/70 ; che :60/70 ; comp sci:65/70 ; maths : 85/100
Bphariharan: these are the marks which i got in my recent pre board
Bphariharan: thanks
Bphariharan: ans my latest Q's pls
Bphariharan: it's maths Qs only
Answered by Bphariharan
2

the 1st if condition is wrong

it should be:

tax=250000;

tax=(taxincome-2500)*0.3


blackpinf4ever: smart kid bro u are
Bphariharan: thanks
Bphariharan: i didn't got ur recent Qs
blackpinf4ever: Hmm??
Bphariharan: bro ans my Qs pls which i have asjed
blackpinf4ever: I'll try
blackpinf4ever: Math??? Umm sry bro. ....my math exam is over so I've forgotten math XD
Bphariharan: bro juat try it pls
blackpinf4ever: I can't do it bro......difficult
Similar questions