{Airline Reservations System) A small airline has just purchased a computer for
ID: 3530176 • Letter: #
Question
{Airline Reservations System) A small airline has just purchased a computer for its new automated
reservations system. The president has asked you to program the new system. You are to write a program to
assign seats on each flight of the airline's only plane (capacity: 10 seats).
Your program should display the following menu of alternatives:
Please type 1 for "first class"
Please type 2 for "economy"
If the person types 1, then your program should assign a seat in the first class section (seats 1-5). If the person
types 2, then your program should assign a seat in the economy section (seats 6-10). Your program should
then print a boarding pass indicating the person
Explanation / Answer
#include <stdio.h>
int main()
{
char answer;
int i,j;
int firstClass[5]={1,2,3,4,5,};
int economy[5]={6,7,8,9,10};
printf("Please type 1 for 'first class' ");
printf("Please type 2 for 'economy' ");
scantf("%c",&answer);
if(answer='1')
printf("Your seat number is %d and %c.",firstClass,first class);
if(answer='2')
printf("Your seat number is %d and %c.,economy[j],economy")
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.