S
shannon
Hi all,
i am new to javascript and was wondering if anyone can help with this
assignment?
Any help will be great.
Shannon
A small airline has just purchased a computer for its new automated
reservation system. You have been asked to program the new system. You
are to write a JavaScript program to assign seats on the next flight of
the airline's only plane (capacity 10 seats). Your program should
display a web page that asks for the passenger name and provides the
following alternatives: Please type 1 for "First Class" and Please
type 2 for "Economy". If the person types 1, your program should
assign a seat in the first class section (seats 1-5). If the person
types 2, your program should assign a seat in economy section (seats
6-10). Your program should output boarding pass information indicating
the passenger name, seat number, and whether it is in the first class
or economy section of the plane.
Your program should, of course, never assign a seat that has already
been assigned. When the first class section is full, your program
should ask the person if it is acceptable to be placed in the economy
section (and vice versa). If yes, then make the appropriate seat
assignment. If no, then output the message: " Next flight leaves in 3
hours."
Your program should be able to output a list of passengers who have
reservations.
Hint: Use an array to represent the seating chart of the plane. As each
seat is assigned, store the passenger name in the corresponding array
element to indicate that the seat is no longer available.
i am new to javascript and was wondering if anyone can help with this
assignment?
Any help will be great.
Shannon
A small airline has just purchased a computer for its new automated
reservation system. You have been asked to program the new system. You
are to write a JavaScript program to assign seats on the next flight of
the airline's only plane (capacity 10 seats). Your program should
display a web page that asks for the passenger name and provides the
following alternatives: Please type 1 for "First Class" and Please
type 2 for "Economy". If the person types 1, your program should
assign a seat in the first class section (seats 1-5). If the person
types 2, your program should assign a seat in economy section (seats
6-10). Your program should output boarding pass information indicating
the passenger name, seat number, and whether it is in the first class
or economy section of the plane.
Your program should, of course, never assign a seat that has already
been assigned. When the first class section is full, your program
should ask the person if it is acceptable to be placed in the economy
section (and vice versa). If yes, then make the appropriate seat
assignment. If no, then output the message: " Next flight leaves in 3
hours."
Your program should be able to output a list of passengers who have
reservations.
Hint: Use an array to represent the seating chart of the plane. As each
seat is assigned, store the passenger name in the corresponding array
element to indicate that the seat is no longer available.