0
Bob was hired as an airport information officer and needs to generate status messages for each flight․ Let’s help him! Complete
The code i have written is giving an error
8 Answers
+ 5
Post ur code , so we can help solve the error.
+ 2
Here's my code, hope it helps:
function main() {
var flightNumber = readLine();
var flightStatus = readLine();
var flight1 = new flight(flightNumber,flightStatus)
console.log('The flight ' + flight1.number + ' is ' + flight1.status)
}
function flight(flightNumber, flightStatus) {
this.number = flightNumber;
this.status = flightStatus;
};
0
Post the link to your "error code"
0
My code
0
We can't see your code from code coach, copy paste it on platform and share the link here :p
0
function main() {
//take flight number and its status
var flightNumber = readLine();
var flightStatus = readLine();
var flight1;
//assign a flight object to flight1 variable
//output
}
function Flight(number, status) {
//fix the constructor
this.number = flightNumber ;
this.status = flightStatus ;
};
var flight1 = new Flight;
console.log('The flight ' + flight1.number + ' is ' + flight1.status);
0
My code