Tines+; 1 import java, to.File; 2 import java. Lo.FileNotFoundExcept ion; 3 import java. to.FLleriter; 4 import java. io.10Exception; 5 import java.util.ArrayList; 6 import java.util.Scanner; 39 40 41 fileReader.close( ); 42 } catch (FileNotFoundExcept Lon e) { System.out.printin( "File with given name not found" )3; e.printStackTracel); 43 44 45 8 public class Main 46 47 static public double calcTax( double salary , double taxRate) try ( 10 48 Filewriter mywriter = new Filewriter("taxinfo.txt", true)) 49 11 12 double taxowed e taxowed (salary taxtate)/ 100; return taxowed; 13 50 System.out. printin( "Records started in file...."); for (int i ; t< name.size( ); i++) 14 51 15 52 16 public static void nain(String[] args) throws IOException 53 String nameP nane.get(); String companyName - company_name.get(i); double salaryP- salary.get(i); double taxRate , taxOwed 17 54 18 55 19 Arraylistdoubles salary new ArrayListdouble>() ArrayListestring nane new ArrayList(); int lines- 1; 56 20 57 21 58 Lf(salary.get(i) 100000e0){ taxRate 40; 22 23 59 60 } elsel taxRate- 53; 24 try { File myFLle new FLlel taxpayer.txt"); 25 61 26 62 27 Scanner fileReader = new Scanner(myFilel; while (fileReader.hasNextLinel )) ( taxowed = calcTaxt salary-get(i), taxRate); string tax String.valueof(taxOwed); 63 28 64 29 string data = fileReader.nexti inel ); 65 30 myir iter.write( nameP"\n"companyNane"\nsalaryP\n+tax+"\n): 31 LT(Lines 3 1H 66 32 nane. add( data): Jelse if(1ines 3 2H 67 System.out.printIn( nameP-Vn+companyName; AEE 68 34 conpany_nane. add( data): 69 35 Jelset 70 36 double sal Double.parseDoublet datal; salary.addi sal); 71 } 72 37 38
Tines+; 1 import java, to.File; 2 import java. Lo.FileNotFoundExcept ion; 3 import java. to.FLleriter; 4 import java. io.10Exception; 5 import java.util.ArrayList; 6 import java.util.Scanner; 39 40 41 fileReader.close( ); 42 } catch (FileNotFoundExcept Lon e) { System.out.printin( "File with given name not found" )3; e.printStackTracel); 43 44 45 8 public class Main 46 47 static public double calcTax( double salary , double taxRate) try ( 10 48 Filewriter mywriter = new Filewriter("taxinfo.txt", true)) 49 11 12 double taxowed e taxowed (salary taxtate)/ 100; return taxowed; 13 50 System.out. printin( "Records started in file...."); for (int i ; t< name.size( ); i++) 14 51 15 52 16 public static void nain(String[] args) throws IOException 53 String nameP nane.get(); String companyName - company_name.get(i); double salaryP- salary.get(i); double taxRate , taxOwed 17 54 18 55 19 Arraylistdoubles salary new ArrayListdouble>() ArrayListestring nane new ArrayList(); int lines- 1; 56 20 57 21 58 Lf(salary.get(i) 100000e0){ taxRate 40; 22 23 59 60 } elsel taxRate- 53; 24 try { File myFLle new FLlel taxpayer.txt"); 25 61 26 62 27 Scanner fileReader = new Scanner(myFilel; while (fileReader.hasNextLinel )) ( taxowed = calcTaxt salary-get(i), taxRate); string tax String.valueof(taxOwed); 63 28 64 29 string data = fileReader.nexti inel ); 65 30 myir iter.write( nameP"\n"companyNane"\nsalaryP\n+tax+"\n): 31 LT(Lines 3 1H 66 32 nane. add( data): Jelse if(1ines 3 2H 67 System.out.printIn( nameP-Vn+companyName; AEE 68 34 conpany_nane. add( data): 69 35 Jelset 70 36 double sal Double.parseDoublet datal; salary.addi sal); 71 } 72 37 38
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Please help I am having errors
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 5 steps with 6 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education