Question: Provided to you is a CSV file called Aircraft.csv which lists the name, year they first appeared and the Country of origin of World War

Provided to you is a CSV file called Aircraft.csv which lists the name, year they first appeared and the Country of origin of World War II aircraft. Use this as a basis for doing the following questions.

Create a Class file Aircraft.java for storing information pertaining to the WWII aircraft. The class should contain fields for the above information and appropriate getters. It should also contain a constructor that talks in an Array of Strings

Create a Java file called AircraftInfo.java and include the following methods in the file:

public static ArrayList loadInfo(String sFileName)

This method should take in the name of the file that stores our aircraft information (Aircraft.cvs) and return an ArrayList of Aircraft as defined above.

public static void writeAircraftObjects(ArrayList obList, String sFile)

This method will go though and write out all the Aircraft objects in the given linked list to the file whose name is given as the 2nd argument to this method. Write these entries using object serialization.

public static void writeRAFAircraft(ArrayList obList, String sFileName)

This method will write out all Aircraft entries in the given ArrayList to the given file in Random Access format. Note that you are going to have to modify your Aircraft class to achieve this as all Aircraft records should be the same size.

public static Aircraft getRAFRec(String sFile, int nPosition)

This method will return the Aircraft record in the nPosition record in the given file (which is assumed to be in Random Access format). Return null if the nPosition refers to a record that is out of scope for the given file.

//Aircraft.csv

Provided to you is a CSV file called Aircraft.csv which lists the

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!