Question: The starter code is provided, and the input file is named p2.txt. IN JAVA please the txt in p2.txt is below: 6767 iron man 670000000.98

The starter code is provided, and the input file is named p2.txt. IN JAVA please

the txt in p2.txt is below:

6767 iron man 670000000.98 565 black panter 787008.98 768565 hulk 56566.56 343 spider man 787.90

The starter code is provided, and the input file is named p2.txt.IN JAVA please the txt in p2.txt is below: 6767 iron man670000000.98 565 black panter 787008.98 768565 hulk 56566.56 343 spider man 787.90the

The input file consists of a number of records consisting of an account number, name and balance arated by tabs. Write a program that 1. reads this file into an string array list 2. prints the total number of records 3. repeatedly ask user to enter a line number between 1 and n, where n is the number of lines from the file, 4. checks if the line number is between 1 and n, prompts user otherwise to reenter 5. display the record on that line 6. quits if the user enters 1 In your program write and use the following method returns the record at nth line input: file2-1.txt . You must download this file, save it in the files subfolder in the project folder and provide this filename to the Scanner in the starter code. // add your code here to store the file contents // close scanner in.close(); // print total number of records // to read user's input Scanner in2 = new Scanner(System.in); // add your code here for user input // and to display the corresponding line // exit when input is - 1 while(in2.hasNextint())\{ int n= in2.nextint(); in2.close()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!