Morning,
I am using Turbo 4.5 Borland for C++. Currently working on a program of an Airline Reservation system. The program is suppose to assign seats for FirstClass and Economy section. Once they select their section I am suppose to assign them a seat number and print a boarding pass that will display their section and seat number. However when I debug I receive the below error message and can not find what could be wrong with the code. Below I have attached the error message and my codes. Any help would be greatly appreciated
******************error message***************************
Error AIRLINE.CPP 81: Statement missing; in function DisplayBoardPass(int, int)
Warning AIRLINE.CPP 86: Parameter 'section' is never used in function DisplayBoardPass(int, int)
Warning AIRLINE.CPP 86: Parameter 'seatnbr' is never used in function DisplayBoardPass(int, int)
************end****error message***************************
//Airline.cpp
#include <iostream.h>
#define YES 1
#define NO 2
#define First_Class 1
#define Economy 2
void DisplayMenu(void);
int getMenuSelection(void);
int AssignSeats(int section);
void DisplayMenuErr(void);
void DisplayBoardPass(int section, int seatnbr);
void DisplayAltChoice(void);
void DisplayNextFlight(void);
void DisplayEndMenu(void);
int FirstClassAssign = 0;
int EconomyAssign = 0;
int main(void)
{
int section;
int seatnbr;
DisplayMenu();
section = getMenuSelection();
seatnbr = AssignSeats(section);
DisplayBoardPass(section, seatnbr);
return 0;
}
void DisplayMenu()
{
cout << endl
<< "Menu of Seating Options" << endl
<< " 1) First Class" << endl
<< " 2) Economy" << endl
<< "Please enter your choice: ";
return;
}
int getMenuSelection ()
{
int selection;
cin >> selection;
getMenuSelection();
if ((selection != First_Class) && (selection != Economy))
{
DisplayMenuErr();
return getMenuSelection();
}
return selection;
}
int AssignSeats(int section)
{
int FirstClassSeatNbr = 0;
int EconomySeatNbr = 4;
if (section == First_Class)
{
FirstClassSeatNbr++;
return FirstClassSeatNbr;
}
else
{
EconomySeatNbr++;
return EconomySeatNbr;
}
}
void DisplayMenuErr()
{
cout << endl
<< "Incorrect choice!" << endl
<< "Please select again." << endl;
return;
}
void DisplayBoardPass(int section, int seatnbr)
{
cout << endl
<< "Boarding Pass for Rosalyn's Airline International" endl
<< "Section: " << section << endl
<< "Seat number: " << seatnbr << endl
<< endl;
return;
}
//void DisplayAltChoice()
//{
// cout << "First Class is currently full." endl
// << "Would you like to reserve a seat in the Ecomony section?" endl
// << "Please enter(Y/N): " endl;
// return;
//)
//void DisplayNextFlight()
//{
// cout <<"Next Flight leaves in 3 hours.";
// return;
//}
//void DisplayEndMenu()
//{
// cout << "Thank You for using Rosalyn's Airline Reservation System!" endl
// << "Please come again and Have a Nice Day!" endl
// return;
//}
I am using Turbo 4.5 Borland for C++. Currently working on a program of an Airline Reservation system. The program is suppose to assign seats for FirstClass and Economy section. Once they select their section I am suppose to assign them a seat number and print a boarding pass that will display their section and seat number. However when I debug I receive the below error message and can not find what could be wrong with the code. Below I have attached the error message and my codes. Any help would be greatly appreciated
******************error message***************************
Error AIRLINE.CPP 81: Statement missing; in function DisplayBoardPass(int, int)
Warning AIRLINE.CPP 86: Parameter 'section' is never used in function DisplayBoardPass(int, int)
Warning AIRLINE.CPP 86: Parameter 'seatnbr' is never used in function DisplayBoardPass(int, int)
************end****error message***************************
//Airline.cpp
#include <iostream.h>
#define YES 1
#define NO 2
#define First_Class 1
#define Economy 2
void DisplayMenu(void);
int getMenuSelection(void);
int AssignSeats(int section);
void DisplayMenuErr(void);
void DisplayBoardPass(int section, int seatnbr);
void DisplayAltChoice(void);
void DisplayNextFlight(void);
void DisplayEndMenu(void);
int FirstClassAssign = 0;
int EconomyAssign = 0;
int main(void)
{
int section;
int seatnbr;
DisplayMenu();
section = getMenuSelection();
seatnbr = AssignSeats(section);
DisplayBoardPass(section, seatnbr);
return 0;
}
void DisplayMenu()
{
cout << endl
<< "Menu of Seating Options" << endl
<< " 1) First Class" << endl
<< " 2) Economy" << endl
<< "Please enter your choice: ";
return;
}
int getMenuSelection ()
{
int selection;
cin >> selection;
getMenuSelection();
if ((selection != First_Class) && (selection != Economy))
{
DisplayMenuErr();
return getMenuSelection();
}
return selection;
}
int AssignSeats(int section)
{
int FirstClassSeatNbr = 0;
int EconomySeatNbr = 4;
if (section == First_Class)
{
FirstClassSeatNbr++;
return FirstClassSeatNbr;
}
else
{
EconomySeatNbr++;
return EconomySeatNbr;
}
}
void DisplayMenuErr()
{
cout << endl
<< "Incorrect choice!" << endl
<< "Please select again." << endl;
return;
}
void DisplayBoardPass(int section, int seatnbr)
{
cout << endl
<< "Boarding Pass for Rosalyn's Airline International" endl
<< "Section: " << section << endl
<< "Seat number: " << seatnbr << endl
<< endl;
return;
}
//void DisplayAltChoice()
//{
// cout << "First Class is currently full." endl
// << "Would you like to reserve a seat in the Ecomony section?" endl
// << "Please enter(Y/N): " endl;
// return;
//)
//void DisplayNextFlight()
//{
// cout <<"Next Flight leaves in 3 hours.";
// return;
//}
//void DisplayEndMenu()
//{
// cout << "Thank You for using Rosalyn's Airline Reservation System!" endl
// << "Please come again and Have a Nice Day!" endl
// return;
//}