ok my teacher wants me to write a program using these instructions :
A small airline has just purshased a computer for its new automated reserations 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: 10 seats). Your program should display the following menu alternatives--Please type 1 for "First Class" and PLease type 2 for "Economy". If the persons types 1, YOur program should assign a seat in the first class section (seat 1-5). If the person types 2, Your program should assign a seat in the economy section (seats 6-10). Your program should print a boarding pass indicating the person's seat number and whether it is in the first class or economy section of the plane.
Use one-dimensional 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, 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 viceversa). If yes, then make the appropiate seat assignment. If no, the print the message "Next flight leaes in 3 hours".
this is what i have so far and i need to know what can i do assign each section a seat, but individually, i don't want it to print all together, i just want to ask do yo want first class or economy depending on the answer i assign the corresponding seat can someone help me pleaseee what is im doing wrong
//Airplane Reservation System
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <iomanip>
using std::setw;
int main()
{
int firstClass = 0;//first class section
int economy = 0;//economy section
int sections= 0;//to choose the section of the seats
int total = 0;
int sectionsCounter = 0;
//use an array for the capacity of 10 seats
int seats[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
//Menu Alternatives
cout<<"Please type 1 for ""First Class"":"<<"\n"<<endl;
cout<<"Please type 2 for ""Economy"":"<<endl;
cin>>sections;
//use an if statement to assign a seat in first class
if ( sections == 1)
{
sections = 1;
cout<<"First Class"<<setw (13)<<"Seats"<<endl;
for ( int i = 0; i <= 4; i++)
cout<<setw(7)<<sections<<setw (13)<<seats<<endl;
}//end of if
//use a if statement to assign a seat in economy section
else
if ( sections == 2)
{
sections = 1;
cout<<"Economy"<<setw (13)<<"Seats"<<endl;
for ( int i = 5; i < 10; i++)
cout<<setw(7)<<sections<<setw (13)<<seats<<endl;
}//end of if
system("pause");
return 0;
}//end of main