O Mainjava>- import java. io.File; 1 2 import java.io.FilelotFoundException; import java. io.Filewriter; iport java.io.IOException; 3\ 4. import java.util.Arraylist; import java.util.Scanner; public class Main 10 static public double calcTax (double salary, double taxRate) 11 12 double taxOwed= 0; taxOwed = (salary taxRate) / 180; return taxOwed; 13 14 15 16 Run | Debug public static void main(Strinc[] args) throws I0Exception 17 18 19 Arraylist salary - new Arraylist(); 20 ArrayList name - new Arraylist(); Arraylist company_name - new Arraylist(); // int lines 1; 21 22 23 24 try{ File myFile - new File(pathname: "taxpayer.txt"); Scanner fileReader- new Scanner (myFile); 25 26 Ln 5, Col 28 Spaces 4 UTF O Mainjava X E taspayer bt Fuenfbt O Mainjava 24 try{ File myFile - new File(pathnane: "taxpayer.txt"); Scanner fileReader - new Scanner (myFile); 25 26 27 while(fileReader.hasNextline()){ 28 String data - fileReader.nextLine(); 29 System.out.printin(data); String[] datahrr - data. split(regex: ", "); name. add(dataArr[0] + " "+ dataArr[1] ); company_name.add (dataarr(2]); double sal - Double.parseDouble(dataarr[3]); salary.add(sal); // if(lines X 3 -- 1 ){ 30 31 32 33 34 35 36 // name.add(data); // Jelse if(1ines X 3 2)0 // // }else( // 37 38 company_name. add(data); 39 40 double sal - Double.parseDouble(data); 41 // salary.add (sal); 42 43 // lines; 44 45 filekeader.close(); 46 }catch (FileNotFoundException e){ 47 System.out.println(x: "File with given name not found"); e.printStackTrace(); 48 49 50 Ln 5, Col 28 Spaces 4 UTF O Mainjava X F taxpayer.bt Ftaint bt O Mainjava>. 48 e.printStackTrace(); 49 50 try(Fileiriter myiriter- new Filewriter(fileName: "taxinf.txt", append: true)) 51 52 System.out.println(x: "Records started in file .."); for (int i-0; i
O Mainjava>- import java. io.File; 1 2 import java.io.FilelotFoundException; import java. io.Filewriter; iport java.io.IOException; 3\ 4. import java.util.Arraylist; import java.util.Scanner; public class Main 10 static public double calcTax (double salary, double taxRate) 11 12 double taxOwed= 0; taxOwed = (salary taxRate) / 180; return taxOwed; 13 14 15 16 Run | Debug public static void main(Strinc[] args) throws I0Exception 17 18 19 Arraylist salary - new Arraylist(); 20 ArrayList name - new Arraylist(); Arraylist company_name - new Arraylist(); // int lines 1; 21 22 23 24 try{ File myFile - new File(pathname: "taxpayer.txt"); Scanner fileReader- new Scanner (myFile); 25 26 Ln 5, Col 28 Spaces 4 UTF O Mainjava X E taspayer bt Fuenfbt O Mainjava 24 try{ File myFile - new File(pathnane: "taxpayer.txt"); Scanner fileReader - new Scanner (myFile); 25 26 27 while(fileReader.hasNextline()){ 28 String data - fileReader.nextLine(); 29 System.out.printin(data); String[] datahrr - data. split(regex: ", "); name. add(dataArr[0] + " "+ dataArr[1] ); company_name.add (dataarr(2]); double sal - Double.parseDouble(dataarr[3]); salary.add(sal); // if(lines X 3 -- 1 ){ 30 31 32 33 34 35 36 // name.add(data); // Jelse if(1ines X 3 2)0 // // }else( // 37 38 company_name. add(data); 39 40 double sal - Double.parseDouble(data); 41 // salary.add (sal); 42 43 // lines; 44 45 filekeader.close(); 46 }catch (FileNotFoundException e){ 47 System.out.println(x: "File with given name not found"); e.printStackTrace(); 48 49 50 Ln 5, Col 28 Spaces 4 UTF O Mainjava X F taxpayer.bt Ftaint bt O Mainjava>. 48 e.printStackTrace(); 49 50 try(Fileiriter myiriter- new Filewriter(fileName: "taxinf.txt", append: true)) 51 52 System.out.println(x: "Records started in file .."); for (int i-0; i
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
100%
Please help how do I put all information in line during the output both the code and my example are presented below in the photos
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 2 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY