Question: Im stuck at the addpassenger method. Can anyone please help public class FlightManagement System { * * Each entry in a 'passengers' map contains *

 Im stuck at the addpassenger method. Can anyone please help publicclass FlightManagement System { * * Each entry in a 'passengers' map

Im stuck at the addpassenger method. Can anyone please help

public class FlightManagement System { * * Each entry in a 'passengers' map contains * a unique ID (this is different from the flightID defined in the passenger class), and its associated information object. */ HashMap passengers; * Each entry in a 'flights' map contains * a unique id (this is different from the flightID defined in the passenger class) and its associated information object. HashMap flights; /** * Initialize an empty database. */ public FlightManagement System() { /** * Add a new passenger entry. * @param id - id of the passenger * @param info - information object of the passenger * @throws IdAlready existsExceptoin if 'id' is an existing passenger id */ public void addPassenger (String id, Passenger Info info) throws IdAlreadyExistsExceptoin { package fms; + import static org.junit. Assert. *; . public class Tester i FlightManagement System db; /* * This method is executed before each test method is executed. */ @Before public void setup() { db = new FlightManagementsystem(); private void addPassengers() { try { r("el", new PassengerInfo("Heeyeon" db.addPassenger ("e2", new PassengerInfo("Jiyoon" db.addPassenger ("e3", new PassengerInfo("Jaebin" db.addPassenger("e4", new PassengerInfo("Suyeon" db.addPassenger("e5", new PassengerInfo("Yuna" db.addPassenger ("e6", new PassengerInfo("Sunhye" db.addPassenger ("e7", new PassengerInfo("Jihye" } catch (IdAlreadyExistsExceptoin e) { // exception not expected fail(); 10, 2000)); , 50, 2577)); , 70, 2000)); , 70, 2577)); , 50, 990)); , 30, 2577)); , 70, 990)); private void addFlights() { try { db.addFlight(2000, new FlightInfo("London Toronto" , "AirCanada")); db.addFlight(2577, new FlightInfo("Paris London" "AirFrance")); db.addFlight(990, new FlightInfo("ParisToronto", "UnitedAirlines")); } catch (IdAlreadyExistsExceptoin e) { 11 avrentinn not ovnerted

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!