Create a program that keeps track of specific information


Create a program that keeps track of specific information for Students.

The information stored should be the following: First Name, Last
Name, Major, GPA, UIN, NetID, Age, Gender.

For this simple program we will only need to store 10 students in an arrayList.

Your students should be stored in an object called Student.

You should be able to add and remove Students in the arrayList.

TennisArrayListjava
main()

Create an ArrayList of type TennisPlayer. Then call two methods, fillTennisArrayList() and printTennisPlayers(), with the ArrayList as the argument.

fillTennisArrayList()

This method defines one parameter, an ArrayList of type TennisPlayer.

The input file includes information about a number of tennis players. For each player, their name, country, rank, age, wins and losses are provided, each on its own line. The file provided includes information for seven players, but the file may contain information for any number of players. However, the format of six lines for each player will be the same and the information will be in the same order.

Iterate through the file using a while loop. For each tennis player, obtain all the information for that player, create a TennisPlayer object using the information from the file, and add the TennisPlayer object to the ArrayList.

When method completes using the provided file, the ArrayList will contain seven TennisPlayer objects.

printTennisPlayers()

This method defines one parameter, an ArrayList of type TennisPlayer. Iterate through the ArrayList and print the tennis player information using the displayPlayer() method in the TennisPlayer class.

Notes:

- Hard code the name of the file, tennisplayers.txt, into your program.

- You may encounter a Scanner.nextLine issue within this program. There are two remedies. The first is to use nextLine to get each line and then convert the numers to ints using Integer.parseInt(). Another way is below, assuming iFile is your Scanner object.
if (iFile.hasNextLine () )
iFile.nextLine 0 ;
- Make sure the method printTennisPlayers() is printing the contents of the ArrayList passed to the method

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Create a program that keeps track of specific information
Reference No:- TGS02710272

Now Priced at $10 (50% Discount)

Recommended (90%)

Rated (4.3/5)