I am writing a program that reads data from a file, converts it to integers and than displays 30% of the value...but i cannot get it to work...can someone give me a tip on this please.....
public class K { public static void main (String[] args) throws IOException { int value; String fileName; String income; double finalList=0; fileName=JOptionPane.showInputDialog("Enter the file name: "); try { double tax = 0; FileReader freader=new FileReader(fileName); BufferedReader inputFile= new BufferedReader(freader); income= inputFile.readLine(); value=Integer.parseInt(income); while(income!=null) { tax=(value)*.30; finalList+=tax+'\n'; income=inputFile.readLine(); tax=Double.parseDouble(income); } JOptionPane.showMessageDialog(null, tax+'\n'); inputFile.close(); } catch (FileNotFoundException e) { JOptionPane.showMessageDialog(null, "file not found"); } } }