Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You defined Hotel class and Flight class correctly in their same named source file, but redefined them as inner class of the Reservation again. And
You defined Hotel class and Flight class correctly in their same named source file, but redefined them as inner class of the Reservation again. And you inner class Reservation in the Reservation class.
public class Reservation
private String customerName;
private Flight flight;
private Hotel room;
Nonargument constructor
public Reservation
public class Flight
private String airlines;
private int flightNumber;
private double flightFare;
Nonargument constructor
public Flight
Full constructor
public FlightString airlines, int flightNumber, double flightFare
this.airlines airlines;
this.flightNumber flightNumber;
this.flightFare flightFare;
Set and get methods for airlines
public void setAirlinesString airlines
this.airlines airlines;
public String getAirlines
return airlines;
Set and get methods for flightNumber
public void setFlightNumberint flightNumber
this.flightNumber flightNumber;
public int getFlightNumber
return flightNumber;
Set and get methods for flightFare
public void setFlightFaredouble flightFare
this.flightFare flightFare;
public double getFlightFare
return flightFare;
@Override
public String toString
return "Airlines: airlines Flight Number: flightNumber Flight Fare: $ flightFare;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started