The fleet class includes a constructor that creates an array to store the entire fleet of Delta airlines. It also had method to read and write files, sort the array by registration number, add and remove aircraft, display the fleet and maintenance lists, update aircraft miles and maintenance , and display information about specific aircraft. Could you please explain it in Java?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

The fleet class includes a constructor that creates an array to store the entire fleet of Delta airlines. It also had method to read and write files, sort the array by registration number, add and remove aircraft, display the fleet and maintenance lists, update aircraft miles and maintenance , and display information about specific aircraft. Could you please explain it in Java?

Fleet class:
Instance Variables
An array that stores Aircraft that represents Delta Airlines entire fleet
A variable that represents the count for the number of aircraft in the fleet
Methods:
o Constructor-One constructor that instantiates the array and sets the count to aero
readFile()-This method accepts a string that represents the name of the file to be
read. It will then read the file. Once the data is read, it should create an aircraft and
then pass the vehicle to the addAircraft method. It should not allow any duplication
of records. Be sure to handle all exceptions.
o writeFile()-This method accepts a string that represents the name of the file to be
written to and then writes the contents of the array to a file. This method should
call a sort method to sort the amay before writing to it.
sortArray()-This method returns a sorted array. The array is sorted by registration
number.u
addAircraft- This method accepts an aircraft and adds it to the fleet(the array only
if it is not already in the list.
displayFleet)-This method outputs all of the ships and shuttles that are in the fleet.
o display Maintenancetist()-This method outputs all aircraft in the array that currently
require maintenance, either by miles or date.
o displayNextMaintenancetist() This method outputs all aircraft in the fleet by
name, manufacturer, model, next maintenance date, and next maintenance miles
o updateMiles) This method accepts a regNumber and miles and updates the total
miles for the designated aircraft based on regNumber
update Maintenance()- This method accepts a regNumber and changes the
lastMaintenance date to the current date and resets last maintenance mileage
Transcribed Image Text:Fleet class: Instance Variables An array that stores Aircraft that represents Delta Airlines entire fleet A variable that represents the count for the number of aircraft in the fleet Methods: o Constructor-One constructor that instantiates the array and sets the count to aero readFile()-This method accepts a string that represents the name of the file to be read. It will then read the file. Once the data is read, it should create an aircraft and then pass the vehicle to the addAircraft method. It should not allow any duplication of records. Be sure to handle all exceptions. o writeFile()-This method accepts a string that represents the name of the file to be written to and then writes the contents of the array to a file. This method should call a sort method to sort the amay before writing to it. sortArray()-This method returns a sorted array. The array is sorted by registration number.u addAircraft- This method accepts an aircraft and adds it to the fleet(the array only if it is not already in the list. displayFleet)-This method outputs all of the ships and shuttles that are in the fleet. o display Maintenancetist()-This method outputs all aircraft in the array that currently require maintenance, either by miles or date. o displayNextMaintenancetist() This method outputs all aircraft in the fleet by name, manufacturer, model, next maintenance date, and next maintenance miles o updateMiles) This method accepts a regNumber and miles and updates the total miles for the designated aircraft based on regNumber update Maintenance()- This method accepts a regNumber and changes the lastMaintenance date to the current date and resets last maintenance mileage
o display Aircraft()- This method accepts a regNumber and searches the array for an
aircraft that matches that regNumber and displays the information about that
vehicle.
o removeAircraft()- This method accepts a regNumber and searches the array for that
aircraft. For each item that doesn't match, it will copy the contents to the new
array. It will not copy the contents of the aircraft that is found. In other words, all
aircraft in the array will be moved up a position to fill in the gap in the array.
nu class:
stance Variables:
o An array that stores all of the menu item options
Transcribed Image Text:o display Aircraft()- This method accepts a regNumber and searches the array for an aircraft that matches that regNumber and displays the information about that vehicle. o removeAircraft()- This method accepts a regNumber and searches the array for that aircraft. For each item that doesn't match, it will copy the contents to the new array. It will not copy the contents of the aircraft that is found. In other words, all aircraft in the array will be moved up a position to fill in the gap in the array. nu class: stance Variables: o An array that stores all of the menu item options
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education