Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago