Hi guys
help me..in d following code i jus wish to use scanner to get input at d same time wanna return net salary,which s d deducted salary of tax..
my return statement not working..some mistake i hav done ..suggest me a way to proceed
Thanks in advance
import java.util.*; class Employee { double salary,tax; double netsalary() { return(salary*tax); } public static void main(String args[]) { double salary,tax; System.out.println("Enter salary"); Scanner scan=new Scanner(System.in); salary=scan.nextDouble(); if(salary>200000 && salary<250000) tax=0.10; else if(salary>250000 && salary<300000) tax=0.20; else tax=0.30; Employee e=new Employee(); System.out.println("Net Salary = "+e.netsalary()); } }