Question: While the file has more data in it: - Read a line of data from the file and store it in a String. Each line

While the file has more data in it: - Read a line of data from the file and store it in a String. Each line in the file contains the bowler's name and three game scores. The line has the format:

lastname, firstname score score score

There is only one space between values. Extract the scores from the String and store them in 3 separate variables. JAVA

This is my code so far. I will attach a file example below my code as an example of what might be on the file. I must be able to extract as many strings that are present in the file, as in data may be added or subtracted. While the file has more data in it: - Read a line

Example of file data:

of data from the file and store it in a String. Each

import java.util.*; import java.io.*; public class lab5 public static void main (String[] args) throws IOException { String fileName; String inputLine; int lineCount 0; scanner scan new Scanner(System.in); System.out.println("Enter file name: "); fileNamescan.nextLine (); Scanner filesc an = new Scanner (new File(fileName)); while (fileScan.hasNext() inputLine fileScan.nextLine(); //print the line we just got from the file System.out.println(inputLine); //count the input line inecount++ /of while file scan //main //class

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!