Program is in C++, program is called airplane reservation. It is suppose to display a screen of seating chart in the format 1 A B C D E F through 10. I had a hard time giving the seats a letter value. It displays a correct screen but when I reserve a new seat the string seats[][] doesn't update to having a X for that seat. Also there is a file for the struct called systemUser.txt it has 4 users in the format 01 Deter Boat username password. The program checks the password and username to see it it's on the list or not. I tried using a flag in the loop but it doesn't work correctly unless it's the last user on the list. So most of the time access is declined. I comment that part out so I could use the other part of the program. Please help the function displaySeats and reservedSeats. And the checkUser function.
*******
PLEASE DON'T ASK FOR MORE INFORMATION, EDITING DOES NOT WORK. SORRY NOT TXT FILES
#include<iostream>
#include<string>
#include<fstream>
#include<cstdlib>
//#define inFile = "systemUser.txt"
using namespace std;
//struct
struct valid_user {
int id;
string first_name;
string last_name;
string username;
string password;
};
const int ROWS = 10; //for rows in airplane
const int COLS = 7;
//protypes for functions
void welcome(); //welcome function
void checkUser(valid_user[]); //username and password match
void menu(); //displays options
void Quit();
void help();
void displaySeats(string[][COLS]);
void reserveSeat(string[][COLS]);
void SaveFile(string[][COLS]);
void cancel(string[][COLS]);
int main() {
ifstream eds; //used to write systemUser
ofstream pds; //used to read text
string seatChar[ROWS][COLS];
int choice; //for menu
string outFile; //used for name of file from user
valid_user check[4]; //max users but should only be 4 users
welcome();
//checkUser(check);
bool repeat = true; //needed for switch loop
while (repeat = true) {
menu();
cout << "-----------------------" << endl;
cout << "Please enter Your Choice (1-7): " <<
endl;
cin >> choice;
cout << "----------------------" << endl;
switch (choice) {
case 1:
cout << "Seating chart looks like this:" << endl;
displaySeats(seatChar);
break;
case 2:
reserveSeat(seatChar);
break;
case 3:
//cancel(seatChar);
break;
case 4:
SaveFile(seatChar);
break;
case 5:
break;
case 6:
help();
break;
case 7:
repeat = false;
Quit();
break;
default:
cout << "You need to enter a number 1-7" << endl;
}//end of switch
}
eds.close();
pds.close();
system ("pause");
return 0;
}
void welcome() {
cout << "---------------------------------------" <<
endl;
cout << " WELCOME TO AIR TICKETS SYSTEM " <<
endl;
cout << "---------------------------------------" <<
endl;
}
void checkUser(valid_user check[]) {
int number;
string first;
string last;
string user;
string Password;
//user input
string userName;
string userPassword;
ifstream eds; //used to write systemUser
ofstream pds; //used to read text
string inFile;
inFile = "systemUser.txt";
eds.open(inFile.c_str());
//protection if file doesn't open
if (eds.fail()) {
cout << "Error opening system user records fie
(systemUser.txt)" << endl;
system("pause");
exit(1);
}
else {
for (int i = 0; i < 4; i++) {
while (eds.eof() == 0) {
eds >> number >> first >> last >> user
>> Password;
check[i].id = number;
check[i].first_name = first;
check[i].last_name = last;
check[i].username = user;
check[i].password = Password;
}
}
cout << "Please enter your user: " << endl;
cin >> userName;
cout << "Please enter your password: " << endl;
cin >> userPassword;
cout << "--------------------------------" <<
endl;
int flag = 0;
for (int i = 0; i < 4; i++) {
if ((userName == check[i].username) && (userPassword ==
check[i].password)) {
flag = 1;
}
cout << flag << endl;
if (flag == 1) {
cout << "Username and Password match!" << endl;
cout << "ACCESS GRANTED" << endl;
cout << "--------------------------------" <<
endl;
cout << " WELCOME TO AIR TICKET SYSTEM " << first
<< " " << last << endl;
cout << "--------------------------------" <<
endl;
}
else {
cout << "Username and password mismatch, access declined!"
<< endl;
cout << "Good-bye" << endl;
system("pause");
exit(1);
}
}
}
}
void menu() {
cout << "---------------------------------------" <<
endl;
cout << " WELCOME TO AIR TICKETS SYSTEM " << endl;
//needs to add user first and last name
cout << "---------------------------------------" <<
endl;
cout << "1. Display Seat Chart" << endl;
cout << "2. Reserve Seat" << endl;
cout << "3. Cancel Reservation" << endl;
cout << "4. Save Seat Chart to File" << endl;
cout << "5. Statistics" << endl;
cout << "6. Help" << endl;
cout << "7. Quit" << endl;
}
void Quit()
{
cout << "Thank You!" << endl;
cout << "Enjoy your Flight" << endl;
system("pause");
exit(0); //Exit the program
}
void help(){
cout << "LOOKS LIKE YOU NEED A LITTLE HELP!!!" <<
endl;
cout << endl;
cout << "Option 1 Displays the avaible seats " <<
endl;
cout << "Option 2 Helps you find an avaiable seat to reserve
" << endl;
cout << "Option 3 Cancels your reservation " <<
endl;
cout << "Option 4 Updates the seating chart file " <<
endl;
cout << "Option 5 Provides all the information about avaiable
and reserved seats for flight " << endl;
cout << "Option 6 Brings you back to this screen " <<
endl;
cout << "Option 7 Quits the program " << endl;
}
void displaySeats(string seats[ROWS][COLS]) {
cout << "\t Window" << "\t" << "Center" <<
"\t" << "Aisle" << "\t" << "Aisle" << "\t"
<< "Center" << "\t" << "Window" <<
endl;
for (int i = 0; i < ROWS; i++) {
cout << i+1;
for (int j = 0; j < COLS; j++) {
if( seats[i][j] == "X"){
seats[i][j] = "X";
cout << seats[i][j] << "\t";
}
else {
seats[i][1] = "A";
seats[i][2] = 'B';
seats[i][3] = 'C';
seats[i][4] = 'D';
seats[i][5] = 'E';
seats[i][6] = 'F';
cout << seats[i][j] << "\t";
}
}
cout << endl;
}//end of else
}
void reserveSeat(string seat[ROWS][COLS]) {
int row;
char col;
cout << "Pleae enter a seat in the form ROW 1-10 and LETTER
A-F [example 2B]: " << endl;
cin >> row >> col;
col = toupper(col);
while (((row > ROWS) || (row <= 0)) &&((col != 'A' ||
'B'||'C'||'D'||'E'||'F'))) {
cout << "You entered a seat that does not exist!!" <<
endl;
cout << "Pleae try again" << endl;
cout << "Please enter a number 1-10 for the row and a letter
A-F for the column: " << endl;
cin >> row >> col;
col = toupper(col);
}
int colVal;
if (col == 'A') {
colVal = 1;
}
else if (col == 'B') {
colVal = 2;
}
else if (col == 'C') {
colVal = 3;
}
else if (col == 'D') {
colVal = 4;
}
else if (col == 'E') {
colVal = 5;
}
else if (col == 'F') {
colVal = 6;
}
if (seat[row-1][colVal] == "X") {
do {
cout << "Seat is already taken." << endl;
cout << "Please try again!" << endl;
cout << "Pleae enter a seat in the form ROW 1-10 and LETTER
A-F [example 2B]: " << endl;
cin >> row >> col;
col = toupper(col);
while (((row > ROWS) || (row <= 0)) && ((col != 'A'
|| 'B' || 'C' || 'D' || 'E' || 'F'))) {
cout << "You entered a seat that does not exist!!" <<
endl;
cout << "Pleae try again" << endl;
cout << "Please enter a number 1-10 for the row and a letter
A-F for the column: " << endl;
cin >> row >> col;
col = toupper(col);
}
//repeats until seat is not taken
} while (seat[row-1][colVal] == "X");
}
else {
if (col == 'A') {
seat[row-1][1] = "X";
}
else if (col == 'B') {
seat[row - 1][2] = "X";
}
else if (col == 'C') {
seat[row - 1][3] = "X";
}
else if (col == 'D') {
seat[row - 1][4] = "X";
}
else if (col == 'E') {
seat[row - 1][5] = "X";
}
else if (col == 'F') {
seat[row - 1][6] = "X";
}
cout << "Your seat was sucessful reserved!" <<
endl;
cout << "Seat: " << row << col<<endl;
} //end of else
}
void SaveFile(string seat[ROWS][COLS]) {
ifstream eds;
ofstream pds;
string outFile; //file name from user
cout << "What is the name of the file you would like to
open?" << endl;
cout << "Enter file name: " << endl;
cin >> outFile;
eds.open(outFile.c_str());
pds.open("chartIn.txt");
for (int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLS; j++) {
pds << seat[i][j] << " ";
}
pds << endl;
}
}
void cancel(string seat[ROWS][COLS]) {
int row;
char col;
cout << "Sorry to hear you want to cancel your flight"
<< endl;
cout << "Please enter you seat you'd like to cancel in
format, rows 1-10 and column A-F [example 2C]: "<<endl;
cin >> row >> col;
col= toupper(col);
while (((row > ROWS) || (row <= 0)) && ((col != 'A'
|| 'B' || 'C' || 'D' || 'E' || 'F'))) {
cout << "That seat is not valid!!" << endl;
cout << "Pleae try again" << endl;
cout << "Please enter a number 1-10 for the row and a letter
A-F for the column: " << endl;
cin >> row >> col;
col = toupper(col);
}
if (seat[row][col] !="X") {
do {
cout << "Error, you entered a seat that has not be reserved
yet!" << endl;
cout << "Try again" << endl;
cout << "Please enter a number 1-10 for the row and a letter
A-F for the column: " << endl;
cin >> row >> col;
col = toupper(col);
} while (seat[row][col] != "X");
//cancelling seat
cout << "You cancelled seat: " << row << col
<< endl;
}//exit after entering resevered seat
//cancel seat when user typed in correctly
else {
}
}
#include<iostream>
#include<string>
#include<fstream>
#include<cstdlib>
//#define inFile "systemUser.txt"
using namespace std;
//struct
struct valid_user {
int id;
string first_name;
string last_name;
string username;
string password;
};
const int ROWS = 10; //for rows in airplane
const int COLS = 7;
//protypes for functions
void welcome(); //welcome function
void checkUser(valid_user[]); //username and password match
void menu(); //displays options
void Quit();
void help();
void displaySeats(string[][COLS]);
void reserveSeat(string[][COLS]);
void SaveFile(string[][COLS]);
void cancel(string[][COLS]);
void initSeatChar(string[][COLS]);
int main() {
ifstream eds; //used to write systemUser
ofstream pds; //used to read text
string seatChar[ROWS][COLS];
initSeatChar(seatChar);
int choice; //for menu
string outFile; //used for name of file from user
valid_user check[4]; //max users but should only be 4
users
welcome();
checkUser(check);
bool repeat = true; //needed for switch loop
while (repeat = true) {
menu();
cout << "-----------------------" << endl;
cout << "Please enter Your Choice (1-7): " <<
endl;
cin >> choice;
cout << "----------------------" << endl;
switch (choice) {
case 1:
cout << "Seating chart looks like this:" << endl;
displaySeats(seatChar);
break;
case 2:
reserveSeat(seatChar);
break;
case 3:
//cancel(seatChar);
break;
case 4:
SaveFile(seatChar);
break;
case 5:
break;
case 6:
help();
break;
case 7:
repeat = false;
Quit();
break;
default:
cout << "You need to enter a number 1-7" << endl;
}//end of switch
}
eds.close();
pds.close();
system ("pause");
return 0;
}
void initSeatChar(string seats[][COLS])
{
for(int i=0; i<ROWS; i++)
{
char buffer[5];
itoa(i+1, buffer, 10);
seats[i][0] = buffer;
seats[i][1] = "A";
seats[i][2] = "B";
seats[i][3] = "C";
seats[i][4] = "D";
seats[i][5] = "E";
seats[i][6] = "F";
}
}
void welcome() {
cout << "---------------------------------------" <<
endl;
cout << " WELCOME TO AIR TICKETS SYSTEM " <<
endl;
cout << "---------------------------------------" <<
endl;
}
void checkUser(valid_user check[]) {
int number;
string first;
string last;
string user;
string Password;
//user input
string userName;
string userPassword;
ifstream eds; //used to write systemUser
ofstream pds; //used to read text
string inFile;
inFile = "systemUser.txt";
eds.open(inFile.c_str());
//protection if file doesn't open
if (eds.fail()) {
cout << "Error opening system user records fie
(systemUser.txt)" << endl;
system("pause");
exit(1);
}
else {
cout << "Please enter your user: " << endl;
cin >> userName;
cout << "Please enter your password: " << endl;
cin >> userPassword;
cout << "--------------------------------" << endl;
int flag = 0;
while (eds) {
eds >> number >> first >> last >> user
>> Password;
if ((userName == user) && (userPassword ==
Password))
{
flag = 1;
break;
}
}
cout << flag << endl;
if (flag == 1) {
cout << "Username and Password match!" <<
endl;
cout << "ACCESS GRANTED" << endl;
cout << "--------------------------------" <<
endl;
cout << " WELCOME TO AIR TICKET SYSTEM " << first
<< " " << last << endl;
cout << "--------------------------------" <<
endl;
}
else {
cout << "Username and password mismatch, access declined!"
<< endl;
cout << "Good-bye" << endl;
system("pause");
exit(1);
}
}
}
void menu() {
cout << "---------------------------------------" <<
endl;
cout << " WELCOME TO AIR TICKETS SYSTEM " << endl;
//needs to add user first and last name
cout << "---------------------------------------" <<
endl;
cout << "1. Display Seat Chart" << endl;
cout << "2. Reserve Seat" << endl;
cout << "3. Cancel Reservation" << endl;
cout << "4. Save Seat Chart to File" << endl;
cout << "5. Statistics" << endl;
cout << "6. Help" << endl;
cout << "7. Quit" << endl;
}
void Quit()
{
cout << "Thank You!" << endl;
cout << "Enjoy your Flight" << endl;
system("pause");
exit(0); //Exit the program
}
void help(){
cout << "LOOKS LIKE YOU NEED A LITTLE HELP!!!" <<
endl;
cout << endl;
cout << "Option 1 Displays the available seats " <<
endl;
cout << "Option 2 Helps you find an available seat to reserve
" << endl;
cout << "Option 3 Cancels your reservation " <<
endl;
cout << "Option 4 Updates the seating chart file " <<
endl;
cout << "Option 5 Provides all the information about
available and reserved seats for flight " << endl;
cout << "Option 6 Brings you back to this screen " <<
endl;
cout << "Option 7 Quits the program " << endl;
}
void displaySeats(string seats[ROWS][COLS]) {
cout << "\tWindow" << "\t" << "Center"
<< "\t" << "Aisle" << "\t" << "Aisle"
<< "\t" << "Center" << "\t" << "Window"
<< endl;
for (int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLS; j++) {
cout << seats[i][j] << "\t";
}
cout << endl;
}//end of else
}
void reserveSeat(string seat[ROWS][COLS]) {
int row;
char col;
cout << "Pleae enter a seat in the form ROW 1-10 and LETTER
A-F [example 2B]: " << endl;
cin >> row >> col;
col = toupper(col);
while (((row > ROWS) || (row <= 0)) &&((col != 'A'
|| 'B'||'C'||'D'||'E'||'F'))) {
cout << "You entered a seat that does not exist!!" <<
endl;
cout << "Please try again" << endl;
cout << "Please enter a number 1-10 for the row and a letter
A-F for the column: " << endl;
cin >> row >> col;
col = toupper(col);
}
int colVal;
if (col == 'A') {
colVal = 1;
}
else if (col == 'B') {
colVal = 2;
}
else if (col == 'C') {
colVal = 3;
}
else if (col == 'D') {
colVal = 4;
}
else if (col == 'E') {
colVal = 5;
}
else if (col == 'F') {
colVal = 6;
}
if (seat[row-1][colVal] == "X") {
do {
cout << "Seat is already taken." << endl;
cout << "Please try again!" << endl;
cout << "Please enter a seat in the form ROW 1-10 and LETTER
A-F [example 2B]: " << endl;
cin >> row >> col;
col = toupper(col);
while (((row > ROWS) || (row <= 0)) && ((col != 'A'
|| 'B' || 'C' || 'D' || 'E' || 'F'))) {
cout << "You entered a seat that does not exist!!" <<
endl;
cout << "Pleae try again" << endl;
cout << "Please enter a number 1-10 for the row and a letter
A-F for the column: " << endl;
cin >> row >> col;
col = toupper(col);
}
//repeats until seat is not taken
} while (seat[row-1][colVal] == "X");
}
else {
if (col == 'A') {
seat[row-1][1] = "X";
}
else if (col == 'B') {
seat[row - 1][2] = "X";
}
else if (col == 'C') {
seat[row - 1][3] = "X";
}
else if (col == 'D') {
seat[row - 1][4] = "X";
}
else if (col == 'E') {
seat[row - 1][5] = "X";
}
else if (col == 'F') {
seat[row - 1][6] = "X";
}
cout << "Your seat was sucessful reserved!" <<
endl;
cout << "Seat: " << row << col<<endl;
} //end of else
}
void SaveFile(string seat[ROWS][COLS]) {
ifstream eds;
ofstream pds;
string outFile; //file name from user
cout << "What is the name of the file you would like to
open?" << endl;
cout << "Enter file name: " << endl;
cin >> outFile;
eds.open(outFile.c_str());
pds.open("chartIn.txt");
for (int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLS; j++) {
pds << seat[i][j] << " ";
}
pds << endl;
}
}
void cancel(string seat[ROWS][COLS]) {
int row;
char col;
cout << "Sorry to hear you want to cancel your flight"
<< endl;
cout << "Please enter you seat you'd like to cancel in
format, rows 1-10 and column A-F [example 2C]: "<<endl;
cin >> row >> col;
col= toupper(col);
while (((row > ROWS) || (row <= 0)) && ((col != 'A' || 'B' || 'C' || 'D' || 'E' || 'F'))) {
cout << "That seat is not valid!!" << endl;
cout << "Pleae try again" << endl;
cout << "Please enter a number 1-10 for the row and a letter
A-F for the column: " << endl;
cin >> row >> col;
col = toupper(col);
}
if (seat[row][col] !="X") {
do {
cout << "Error, you entered a seat that has not be reserved
yet!" << endl;
cout << "Try again" << endl;
cout << "Please enter a number 1-10 for the row and a letter
A-F for the column: " << endl;
cin >> row >> col;
col = toupper(col);
} while (seat[row][col] != "X");
//cancelling seat
cout << "You cancelled seat: " << row << col << endl;
}//exit after entering resevered seat
//cancel seat when user typed in correctly
else {
}
}
Output:
---------------------------------------
WELCOME TO AIR TICKETS SYSTEM
---------------------------------------
Please enter your user:
user1
Please enter your password:
password1
--------------------------------
1
Username and Password match!
ACCESS GRANTED
--------------------------------
WELCOME TO AIR TICKET SYSTEM Deter Boat
--------------------------------
---------------------------------------
WELCOME TO AIR TICKETS SYSTEM
---------------------------------------
1. Display Seat Chart
2. Reserve Seat
3. Cancel Reservation
4. Save Seat Chart to File
5. Statistics
6. Help
7. Quit
-----------------------
Please enter Your Choice (1-7):
1
----------------------
Seating chart looks like this:
Window Center Aisle Aisle Center Window
1 A B C D E F
2 A B C D E F
3 A B C D E F
4 A B C D E F
5 A B C D E F
6 A B C D E F
7 A B C D E F
8 A B C D E F
9 A B C D E F
10 A B C D E F
---------------------------------------
WELCOME TO AIR TICKETS SYSTEM
---------------------------------------
1. Display Seat Chart
2. Reserve Seat
3. Cancel Reservation
4. Save Seat Chart to File
5. Statistics
6. Help
7. Quit
-----------------------
Please enter Your Choice (1-7):
2
----------------------
Pleae enter a seat in the form ROW 1-10 and LETTER A-F [example
2B]:
2B
Your seat was sucessful reserved!
Seat: 2B
---------------------------------------
WELCOME TO AIR TICKETS SYSTEM
---------------------------------------
1. Display Seat Chart
2. Reserve Seat
3. Cancel Reservation
4. Save Seat Chart to File
5. Statistics
6. Help
7. Quit
-----------------------
Please enter Your Choice (1-7):
1
----------------------
Seating chart looks like this:
Window Center Aisle Aisle Center Window
1 A B C D E F
2 A X C D E F
3 A B C D E F
4 A B C D E F
5 A B C D E F
6 A B C D E F
7 A B C D E F
8 A B C D E F
9 A B C D E F
10 A B C D E F
---------------------------------------
WELCOME TO AIR TICKETS SYSTEM
---------------------------------------
1. Display Seat Chart
2. Reserve Seat
3. Cancel Reservation
4. Save Seat Chart to File
5. Statistics
6. Help
7. Quit
-----------------------
Please enter Your Choice (1-7):
7
----------------------
Thank You!
Enjoy your Flight
Press any key to continue . . .
N.B. I have debug the given code. Now it works fine. Whether you need any help then share with me.
Program is in C++, program is called airplane reservation. It is suppose to display a screen...
This program is in C++ which reserves flight seats. It uses a file imported to get the seat chart called "chartIn.txt" which looks like this 1 A B C D E F 2 A B C D E F It continues until row 10. Sorry unable to provide the chartIn.txt file. I am having issues with function displaySeats, it displays then but when it comes to 10 the row looks like this 1 0 A B C D E ,...
Can I get help with adding the following to this code please? 1. When buying multiple tickets, if one of the seats selected is already taken, give a message like "Sorry, one or more of the seats selected is already taken." and prompt the user to select the seats all over. (Or if possible to make it suggest a location where the seats are together that the user can select instead) 2. Print the total cost after all of the...
Hi I need help with a java program that I need to create a Airline Reservation System I already finish it but it doesnt work can someone please help me I would be delighted it doesnt show the available seats when running the program and I need it to run until someone says no for booking a seat and if they want to cancel a seat it should ask the user to cancel a seat or continue booking also it...
I wrote program that have to block all moves for player 1, for game TicTacTOE AI, but it is not working. Can someone check what I have not eliminated? #include using namespace std; const int ROWS = 3; const int COLS = 3; int counter = 0; void aITurn(char b[][COLS]); void fillBoard(char board[ROWS][COLS]); void getChoice(char b[][COLS], bool playerToggle); bool gameOver(char b[][COLS]); void showBoard(char board[ROWS][COLS]); int main() { ///main is complete, nothing to do here char board[ROWS][COLS]; bool playerToggle =...
I'm just a beginner in programming,how to make this program more simple without using #include<iostream> and #include<redex> here is the question Terms to know: If-else statement,for..while..do while,loops,pointer,address,continue,return,break. Create a C++ program which contain a function to ask user to enter user ID and password. The passwordmust contain at least 6 alphanumeric characters, 1 of the symbols !.@,#,$,%,^,&,* and 1 capital letter.The maximum allowable password is 20. Save the information. Test the program by entering the User ID and password. The...
I need help fixing this code and adding a loop
please.
Here is the original problem:
#include <iostream>
using namespace std;
//function to print seating chart
void printSeatingChart(int **chart)
{
int i, j;
cout << "\nROW\t";
for (i = 1; i <= 10; i++)
{
cout << i <<
"\t";
}
cout <<
"\n-----------------------------------------------------------------------------------\n";
for (i = 8; i >= 0; i--)
{
cout << "\n" << i +
1 << "\t";
for (j = 0; j < 10; j++)
...
Hello, I am working on a project for my C++ class, I have the vast majority of the code figured out but am running into a few issues. Mainly updating each * to an X. The problem is as follows:(Airplane Seating Assignment) Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with six seats in each row. Rows 1 and 2 are first class, rows 3 through 7 are business...
Can somebody help me with this coding the program allow 2 players play tic Tac Toe. however, mine does not take a turn. after player 1 input the tow and column the program eliminated. I want this program run until find a winner. also can somebody add function 1 player vs computer mode as well? Thanks! >>>>>>>>>>>>>Main program >>>>>>>>>>>>>>>>>>>>>>> #include "myheader.h" int main() { const int NUM_ROWS = 3; const int NUM_COLS = 3; // Variables bool again; bool won;...
Can you help us!! Thank you!
C++
Write a program that can be used by a small theater to sell tickets for performances. The program should display a screen that shows which seats are available and which are taken. Here is a list of tasks this program must perform • The theater's auditorium has 15 rows, with 30 seats in each row. A two dimensional array can be used to represent the seats. The seats array can be initialized with...
How can I make this compatible with older C++ compilers that DO NOT make use of stoi and to_string? //Booking system #include <iostream> #include <iomanip> #include <string> using namespace std; string welcome(); void print_seats(string flight[]); void populate_seats(); bool validate_flight(string a); bool validate_seat(string a, int b); bool validate_book(string a); void print_ticket(string passenger[], int i); string flights [5][52]; string passengers [4][250]; int main(){ string seat, flight, book = "y"; int int_flight, p = 0, j = 0; int seat_number,...