subject

Project 1b: Create a Flights Database using ArrayList of Objects For this Lab assignment, you will create an ArrayList of Java Objects, populate them and print out the results.

Specifically, you will create an ArrayList of type Flight (ArrayList). A Flight contains an attribute of type AircraftType, which is modeled above. An AircraftType contains an engineType attribute which is an enumeration type called EngineType.

Steps to create this project:

You should study the modules relating to ArrayLists, ArrayList of Objects SimpleDateFormat, and Java Enums.
Create a new project in IntelliJ called for example FlightArrayList and a class FlightArrayList. Follow the pattern in the ArrayLists of Objects module page.
Create the classes Flight and AircraftType and the EngineType enumeration as modeled above. For simplicity, these can be inner classes (Links to an external site.) of your public main class FlightArrayList.
Flight and AircraftType should have public constructors to allow you to easily populate objects of these types.
Flight and AircraftType should have toString() (Links to an external site.) methods that display key Flight and AircraftType and EngineType attributes.
Create a main method that declares a variable of type ArrayList.
To make your life easier, I suggest you create another ArrayList of type ArrrayList and populate it with various aircraft types since a Flight must have an AircraftType. If you have an ArrayList of type ArrrayList pre-populated, you can use the ArrayList get method to refer to an AircraftType, e. g. acType. get(3) where acType is an ArrayList, referring to the fourth element in the AircraftType array list. Set the engineType attributes using one of the EngineType enum values, e. g. EngineType. Jet or EngineType. TurboProp. Set up various aircraft types. Here a few real examples, you can use to populate your AircraftType ArrayList.
AircraftType Examples:

ManufacturerModelType DesignatorEngine TypeNumber Engines
Boeing737-600B736Jet2
Boeing737-800B738Jet2
AirbusA-310A310Jet2
AirbusA-300B2A30BJet2
AirbusA-340-500A-340-500Jet2
EmbraerA-20E314TurboProp1
Embraer195E195Jet2
8. You will also need to set the scheduledArrival and scheduledDeparture times of flights. These schedules are of type Java Date. An easy way to do this to declare a SimpleDateFormat named for example, sdf, then use the sdf to parse a date string into a Java Date.

SimpleDateFormat sdf = new SimpleDateFormat("MM-dd- HH:mm");

// Now you can convert a dateString to a Java date like this:
Date date = sdf. parse("12-10-2020 09:35")

9. With aircraftTypes and dates, you can now create Flights using the Flight constructor. Create five or more flights, varying data, times, aircraft types, destinations, origins, gates, and so on. Gates should start with a letter, followed by a number. Origin and destination should be three-letter airport codes, e. g. PHL, JFK, CDG, LAX, SFO, ORD, MIA, DFW, etc.

10. Finally print out your results: (requires you to define toString() methods in your Flight and AircraftType classes )

for (Flight flt: fltArrayList) {
System. out. println(flt);
}

Sample Output:
AA 101 PHL/ORD Departs: 12-10-2020 07:35 Arrives: 12-10-2020 09:35 Aircraft: Boeing-737-600 EngType/Num: Jet/2 Gate: A27
UA 101 PHL/SFO Departs: 12-10-2020 08:35 Arrives: 12-10-2020 11:50 Aircraft: Airbus-A-310 EngType/Num: Jet/2 Gate: G15
DL 233 ATL/CDG Departs: 12-10-2020 16:35 Arrives: 12-11-2020 07:50 Aircraft: Airbus-A-310 EngType/Num: Jet/2 Gate: B15
WN 101 PHL/LAX Departs: 12-10-2020 08:35 Arrives: 12-10-2020 11:50 Aircraft: Airbus-A-340-500 EngType/Num: Jet/2 Gate: G15
AA 221 MCO/FLL Departs: 12-10-2020 05:35 Arrives: 12-10-2020 07:33 Aircraft: Airbus-A-310 EngType/Num: Jet/2 Gate: C11
UA 199 PHL/JFK Departs: 12-10-2020 08:35 Arrives: 12-10-2020 11:50 Aircraft: Embraer-A-20 EngType/Num: TurboProp/1 Gate: D15

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:00
In outlook how can cherie look at the details of an event that appears on the month view of her calendar? check all that apply. by switching to the detail view by switching to the week view by switching to the day view by right-clicking on the event by double-clicking on the event by highlighting the event
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
Write a program that prints the day number of the year, given the date in the form month-day-year. for example, if the input is 1-1-2006, the day number is 1; if the input is 12-25-2006, the day number is 359. the program should check for a leap year. a year is a leap year if it is divisible by 4, but not divisible by 100. for example, 1992 and 2008 are divisible by 4, but not by 100. a year that is divisible by 100 is a leap year if it is also divisible by 400. for example, 1600 and 2000 are divisible by 400. however, 1800 is not a leap year because 1800 is not divisible by 400.
Answers: 3
question
Computers and Technology, 23.06.2019 19:40
Use a physical stopwatch to record the length of time it takes to run the program. calculate the difference obtained by calls to the method system.currenttimemillis() just before the start of the algorithm and just after the end of the algorithm. calculate the difference obtained by calls to the method system.currenttimemillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. use the value returned by the method system.currenttimemillis() just after the end of the algorithm as the elapsed time.
Answers: 3
question
Computers and Technology, 23.06.2019 20:00
Me ajude por favor , coloquei uma senha e não consigo tira-la no chorme
Answers: 2
You know the right answer?
Project 1b: Create a Flights Database using ArrayList of Objects For this Lab assignment, you will...
Questions
question
English, 22.02.2021 15:30
question
Chemistry, 22.02.2021 15:30
question
Social Studies, 22.02.2021 15:30
question
Mathematics, 22.02.2021 15:30
question
Mathematics, 22.02.2021 15:30
Questions on the website: 13722367