Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribed

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

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

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions

Question

What is the relationship between humans and nature?

Answered: 1 week ago