Objective and Overview: This exercise is to practice object composition, Arrays of Objects, and Array Lists. Problem 1 1. Identify and write classes for the following scenario: In an Airline reservation system, a passenger must present his name, age, and passport number. Each passenger can have up to two pieces of luggage. A piece of luggage must not weigh more than 23KG and its dimensions must not exceed 50 cm in height, 40 cm in width, and 25 cm in depth. If a luggage exceeds the required dimensions, then it is marked as an oversized luggage. If it exceeds the weight limit, then it is marked as a heavy luggage. 2. Draw UML for the above scenario 3. Implement the designed classes, with their attributes and methods. Each class should have three constructors (default, initialization and copy constructors), setters and getters for each attribute, and a toString () method. 4. Make sure you do a deep copy in the initialization and copy constructors, as well as the setters of all attributes. 5. Create a Tester class. In the main method, do the following: a. Create two Passenger objects (pa1 and pa2), each having two pieces of luggage, and print them using the toString() method. b. Create a Passenger object pa3 as a copy of the first passenger pal and print it using its toString () method. c. Change the weight of one of the luggage of the first passenger and print the first passenger again d. Create an array of 10 Passengers and add the three passenger objects to the array.
e. Calculate and print the total weight of all luggage pieces of all passengers in the array. f. Print the passengers who have a heavy luggage g. Print the passengers who have an oversized luggage Problem 2 A flight as a flight number (String), a source city (String) and a destination city (String). A flight also has an array list of passengers (the Passenger class from problem 1). A. Implement the class Flight with all its attributes, constructors, and toString() methods. B. Add a method in the Flight class to read the passenger information from a file and fill the array of passengers. A sample file is provided below. C. Add a method in the Flight class to get the total weight of all luggage pieces of all passengers on the flight. D. Create a test class "TestFlight" to test your classes. a. Create a Flight f1 that has the number "ABC123" that will go from "Abu Dhabi" to "Cairo". b. Fill the passenger array list of the flight by reading the file "passengers.csv" below. c. Display all passengers on the flight. d. Count and display all passengers with luggage pieces that are heavy e. Count and display all passengers with luggage pieces that are oversized Sample input File: Mohammed Ali Hassan, 44, FXE908767, 22.0, 50, 30, 20, 25.5, 40, 30, 20 Khalid Saif, 60, DRW454545, 23.0, 45, 35, 25, 20.5, 40, 22, 20 Maryam Abdullah, 25, ABC546576, 26.0, 60, 30, 20 Alia Saeed Rashed, 29, GHT657645, 22.0, 50, 45, 20, 22.5, 40, 30, 20