Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have to code the \"Airline\" class and \"Passenger\" class Please write the fu

ID: 3734586 • Letter: I

Question

I have to code the "Airline" class and "Passenger" class

Please write the full code

Working on Eclipse,

Do not asnswer it if you do not know it

locationList: LocationList departure: String arrival: String departureTime: Date arrival Time: Date passengerCount: Int database Database resuits: LiskFlight manager: DBManager Viewer for searching for flights 1+searchByQuerylq:Query): List departure: String arrival String departure Time: Date arrivalTime: Date numberOlSeats: Int price: int class (test, coach): String entertainment: boolean luggage : String View layer seats : List-Seab airlineName: Sbring avgRating: double totalRatings: Int mySeats: ListcSeab bookingNumber:String flight : Flight food boolean Controller layer + getArrival): String +getDeparture Time : Date getPrice) : int +getclass): String +getPassanger): Passenger Model layer getSeaM) : Seat getBookingNumber: Sering getFlight): Flight +setFlightelight: Flight) : void setBookingNumber(s: String) : void + setSeats(seats: List-Seats>): void +setPassengers(p: List-Passengers>) : void addRating(rating, int) : void +getRatingo : double + getNumberAvailableSeats): int int Storage layer getFood0 :boolean getEntertainment) boclean String getluggageD:String getFlightNo): int 0. Passenger name: String getName): String

Explanation / Answer

class Airline() {
private String airlineName; //Instance variables
private double avgRating;
private int totalRatings;
  
public Airline(String airlineName, double avgRating, int totalRatings) { //construnctor of Airline class
this.airlineName=airineName;
this.avgRating=avgRating;
this.totalRatings=totalRatings
}
  
public addRating(int rating) {
// Calculaing the average rating
this.avgRating=((this.avgrating*this.totalRatings)+rating)/(this.totalRatings+1);
this.totalRatings=this.totalRatings+1 // incrementing the total ratings
}
  
public double getRating() {
return this.avgRating;
}
  
class Passenger() {
private String name; //Instance variable
  
public Passenger(String name) { ////construnctor of Passenger class
this.name=name;
}
  
public String getName() {
return this.name;
}
}