السؤال:-
a small airline has just purchased a computer for its new automated reservations system, You have been asked to program the new system. You are to write a program to assign seats on each flight of the airline's only plane (capacity: 10seats).
Your program should display the following menu of 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 (1-5). IF the person types 2, your program should assign a seat in the economy section (6-10). Your program should print a boarding pass indicating the person's seat number and wether it is in the first class or economy section of the plane.
Use asingle-subscripted array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding elements of the array to 1 to indicate that the seat is no longer available.
Your program should never assign aseat 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 print the message "Next flight leaves in 3 hours."
my wrong answer is here and don't know how to complete plzzz help me
we have to use also file>>
وهاذي محاولتي
#include<iostream.h>
#include<fstream> error
int main()
{
char goTo;
int s[10]={0,0,0,0,0,0,0,0,0,0},n,j=1;
ofstream outf("seats.txt", ios::out);
for (int i=0; i<10; i++)
{
cout<<"Please type 1 for 'First class'\n";
cout<<"Please type 2 for 'Economy'\n";
cin>>n;
}
switch(n)
{
case 1:
outf << "(" << j << "-5)\n";
if(j>5);
}
return 0;
}