Question: not allowed to use methods, in Java that does a list of things and Im struggling. I have to use arrays, but not array lists.

not allowed to use methods, in Java that does a list of things and Im struggling. I have to use arrays, but not array lists. I have a text file formatted like so:

Player Most Passing yards Tom Brady 80560 Drew Brees 80358 Peyton Manning 71940 Brett Favre 71838 Phillip Rivers 63440 Ben Roethlisberger 61381 Dan Marino 61361 Eli Manning 57023 Matt Ryan 56757 Aaron Rogers 54142

I need Java to print the following things

1- The players in order from highest passing yards with both name and yard amount.

2- The players in order from lowest passing yards with both name and yard amount

3- average passing yards

4- players who have passing yards over 65,000 yards.

what I have so far

import java.io.File; import java.io.FileNotFoundException; import java.util.Arrays; import java.util.Scanner; public class football { public static void main(String[] args) throws FileNotFoundException{ Scanner sc = new Scanner(new File("/Users/Downloads/football.txt")); String [] players = new String[sc.nextLine()]; for (int i =0; i < players.length; i++){ players[i] = sc.nextLine(); } for (String line : players){ System.out.println(line); } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To achieve the desired functionality without using methods you can follow these steps 1 Read the dat... View full answer

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 Operating System Questions!