ticket_mod
Version:
ITI/AAIB INTAKE 1
51 lines (41 loc) • 978 B
JavaScript
class ticket {
constructor(sn, fn, da, td)
{
this.seatNum = sn;
this.flightNum = fn;
this.daAirports = da;
this.travelDate = td;
}
getSeatNm(){
return this.seatNum;
}
getFlightNum(){
return this.flightNum;
}
getDaAirports(){
return this.daAirports;
}
getTravelDate(){
return this.travelDate;
}
display(){
return (`Your flight info are as follows:
Seat Number: ${this.seatNum}
Flight Number: ${this.flightNum}
D/A Airports: ${this.daAirports}
Travel Date: ${this.travelDate}`);
}
updateSeatNum(nval){
this.seatNum = nval;
}
updateFlightNum(nval){
this.flightNum = nval;
}
updateAirport(nval){
this.daAirports = nval;
}
updateTravelDate(nval){
this.travelDate = nval;
}
}
module.exports = ticket;