Question: my main concern is how to create the loop for reading only 4 lines from the five-line and ignore the fifth line? I am using
my main concern is how to create the loop for reading only 4 lines from the five-line and ignore the fifth line?
I am using java and struggling with this code which I didn't find at any photo so please help with this issue I need it for my homework my deadline is so close
A main()method according to these requirements: Create a double variable called totalScoringAverage.oCreate a loop. In each iteration of the loop, read five lines from team.txtand pass the first four of the five strings (lines) to createPlayer()(ignoring the fifth line, "-----"). To read the file, use Fileand Scanneras shown in this week's lecture. Depending on your computer, you may need to prefix team.txtwith the full file path, such as "c:\assignments\cs520\hw3\part2\team.txt". There should be a total of 50 lines read in (10 players, 5 lines each). Your loop should notrun a hard-coded number of times; it should end when Scanner's hasNextLine()returns false. When createPlayer()is called for each of the 10 players, add the returned value to totalScoringAverage. After all 10 players have been processed, compute the average for all players (totalScoringAverage/ 10) and print it to the console.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
