Hi i need a help please am doing my collage about airline reservation system in C++,but i keep get errors,this is my codes
#include <iostream>
#include <cctype>
#include <string>
#include <cstring>
using namespace std;
//Declare function proto type
int assignSeat(int seat_num, int row_num, int pass_num);
int num1(char);
int num(char);
if((MenuChoice < 0) && (MenuChoice > 5))
{
cout << "Invalid Choice" << endl;
system("Pause Try Again");
}
else
{
switch(MenuChoice)
{
case 1: Reserve();
break;
case 2: Cancel();
break;
case 3: ChangeSeat();
break;
case 4: Display();
break;
case 5:
exit(1);
}
}
cin.get();
}
return 0;
}
void Reserve() //This function is for reserv the seats
{
int pass_num = 10;
cout << "Wellcome to Airline Passenger seat assignment" << endl;
cout <<"All"<< NumSeats << " seats are available " << endl;
for(int i = 0; i < 10; i++)
{
for(int j = 0; j < 10; j++)
{
if(SeatArray[i][j].Available == 1)
{
cout << "Please enter the passenger name: ";
cin >> SeatArray[i][j].pass_name;
SeatArray[i][j].Available = 0;
NumSeats--;
return;
}
}
}
}
void Cancel()// This function is for Cancel the seat
{
char CancelPassengerName[80];
cout << "Enter the Passenger to be cancelled: ";
cin >> CancelPassengerName;
for(int i =0; i <5; i++)
{
for(int j=0; j<2; j++)
{
if(strcmp(SeatArray[i][j].pass_name, CancelPassengerName) == 0)
{
NumSeats++;
SeatArray[i][j].Available = 1;
return;
}
}
}
cout << " Passenger not in the list" << endl;
}
void ChangeSeat()//This function is for Change the seat
{
char MovePassenger[80];
int SeatRow, SeatColumn;
cout << "Enter the passenger name to be moved: ";
cin >> MovePassenger;
void InitializeSeats()//Initialy all seats are available
{
for(int i = 0; i < 5; i++)
{
for(int j = 0; j < 6; j++)
SeatArray[i][j].Available = 1;
}
}
but i need add codes so when u press 1, for Reserve,under reserve is going to ask the person to make a choice ,1,first class or 2 Ecomomy class,or how i can add this ur codes to it
#include "stdafx.h" //Not used in this code- Can be deleted.
#include <string>
#include <iostream>
using namespace std;
int main()
{
int c, s[10];
int i, j;
string name;
cout << "Welcome to Airline Reservations System!\n";
for (j=0; j<10; j++)
{
cout << "Please enter your name: ";
getline(cin,name);
cout << "Choose a class: ";
cin >> c;
switch(c)
{
case 1:
cout << "First class" << endl;
cout << "Seats available are 1,2,3,4,5.\n";
do {
cout << "Pick a seat: ";
cin >> s[j];
for (i=0; i<j; i++) if (s[j]==s[i]) {cout << "Seat taken. ";
break;}
} while (i!=j);
if(s[j] <= 5)
{