rehamraafattask3
Version:
hello world
43 lines (42 loc) • 1.25 kB
JavaScript
class ticket {
constructor(
seat_id,
flight_num,
source,
destination,
journey_date
) {
this.seat_id = seat_id;
this.flight_num = flight_num;
this.source = source;
this.destination = destination;
this.journey_date = journey_date;
}
//get flight ticket info
//-------------------------
Get_Data() {
return this;
}
//display flight ticket info
//----------------------------
Display_Info() {
console.log(
`Flight info :
Seat ID => ${this.seat_id},
Flight Number => ${this.flight_num},
Origin => ${this.source},
Destination => ${this.destination},
Date of the Journey => ${this.journey_date}.`
);
}
//Update flight ticket info
//----------------------------
Update_Info(x, y, z, a, b) {
this.seat_id = x;
this.flight_num = y;
this.source = z;
this.destination = a;
this.journey_date = b;
}
}
module.exports = { ticket };