C++ Assignment

A Airline has just purchased a computer for its new automated reservation system. You have been asked to build the new Application using C++. The company has a single airplane (capacity 20 seats) that performs two flights per day: flight number FL600 at 10:00 and FL620 at 16:00 respectively. You are to write a program to assign seats on each flight of the airline.
First, your program should read from the keyboard the current time and display the following menu of alternatives if there are still flights during that day (i.e. the menu is displayed only if it's is not 15:30 yet, as all bookings should be done at least 30 minutes before the flight)

1. for "First Class"
2. for "Business Class"
3. for "Economy Class.

If entered time is 15:30 or more, the following message should be displayed:
"Sorry, it's too late to make any booking today! Please, come back tomorrow"
Once the menu displayed, if the airline agent types 1, your program should display the flights that have First
class seats available, if any or the following message: ""Sorry, all first class seats are taken today. Please, try another class or come back tomorrow".
If there are available seats, the agent will choose a flight number (if more than one have available seats), enter the name of the passenger and assign a seat in the first class section (seats 1-5).
If the airline agent types 2, your program should follow the same procedure as before but to assign a seat in the
business section (seats 6 -10), and if the agent types 3, your program should follow the same procedure as before to assign a seat in the economy section (seats 11 - 20).
Once the booking is completed, your program should print/display a boarding pass indicating the person's name, seat number and whether it is in the first class, business class or economy section of the plane. The boarding pass should also indicate how long the passenger should wait before boarding. Note that boarding is always done 30 minutes before flight. It should also print a report of the booking details that includes in addition to the above information, the detailed payment. The payment should include the flight price, the surge charges and the taxes.

1. Program Analysis
-Structured English
-Pseudo code
-Flow chart
2. Program Design Develop C++ program with functions

Source Code and Executable File should be must.

please can someone help me in solving this
Last edited on
Please note, that it is not a homework site. We won't do your homework for you. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.

We didn't see your attemts to solve this youself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again. As it is impossible to find deriviative of function without knowledge in ariphmetics, you cannot do more complex tasks in programming without clear understanding of basics
1
2
3
4
5
6
7
#include "stdio.h"

void main()
{
printf("Post some code you already have and ask specific issues and not the whole code");

}
Hi thanx I have come up with a solution something like this, please if there are any errors do advise me on how to correct it.

#include <iostream>
#include <string>
#include <ctime>
using namespace std;

int get_option(int hours,int mins)
{
int option;
if(hours >=15)
{
cout <<"sorry its too late to make any bookings today!"<<endl;
<<"Please come back tomorrow."<<endl<<endl<<endl;
system ("pause");
return 0;
}

if (hours==9&&mins>=30)(hours>9&&hours<15)(hours==15&&mins<30))

{
cout<<"\n Flight FL620 available will depart at 16:00"<<endl
cin>>endl;
return 0;
}
if hours<=9)
{
cout<<"\nYou have two flights available"<<endl
<<"FL600 departing at 10:00....FL620 departing at 16:00"<<endl
<<"\choose a flight:"<<endl
<<"press '1' for FL600."<<endl
<<"press '2' for FL620."<<endl;
cin>>option;

if (option=='1')
{cout<<"\You have chosen flight FL600"<<endl;]\}
if (option == '2')
{cout<<"\n You have chosen flight FL620"<<endl;}
return option;
}
}
int rows =4;
int columns=5;
size=20;
char seat[rows] [columns]

int main()
{
for (int i=0;i<5;i++)
for (int j=0;i<4;i++)
seat [i][j]="o";
}
void menu()
{
cout<<"welcome to northern airlines\n";
cout<<"please enter one of the following\n";
cout<<" 1. First Class\n";
cout<<" 2. Business Class\n";
cout<<" 3. Economy Class\n";
cin>>menu;

return menu;
}
string seats
{
seats[20]={"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"};
string seats;

options
{
1.
cout<<"\n\n\t**First Class**"<<endl
<<"\t-------"<<endl<<endl;
cout<<"seats available:\n\n\t";

for (int i=0;i<5;i++)
cout<<seat(4)<<seats[i]
cout<<"\n\n Choose your seat:"endl
<<"(eg:1,3)\n";
cin>>seat
break;

2.
cout<<"\n\n\t** Business Class**"<<endl
<<"t------"<<endl<<endl;
cout<<"Seats Available:\n\n\t;

for (int i=5;i<10;i++)
cout<<seats(4)seats[i];

cout<<"\n\n Please choose your seat:"<<endl
<<"(eg.7,9)\n";
cin>>seat;
break;

3.
cout<<"\n\n\t**Economy Class**"<<endl
<<"\t------"<<endl<<endl;
cout<<Seats available:\n\n\t";

for (int i=10;i<20<i++)
cout<<seats(4)<<seats[i];

cout<<"\n\n Please choose a seat:"<<endl
<<"(eg. 12,15)\n";
cin>>seat;
}
return seat;
}
float get_charge

{
float charge;
if(option1==1)
{charge=800.00;}
if(option1==2)
{charge=400.00;}
if(option1==3)
{charge=600;}
return charge;
}

string travel(int option1)
{
string type;
if(option 1==1)
{type="First";}


if(option 1==2)
{type = "Business";}

if(option 1==3)
{type ="Econom";}

return type;
}

void print_Boarding_Pass
{
cout<<"\t "<<endl
<<"\t Boarding Pass"<<endl
<<"\t Passenger Name: "name<<.<<endl<<endl
<<"\t Seat Number: "<<seat<<.<<endl<<endl
<<"t Class: "<<type<<"Class."<<endl<<endl
<<"\t Flight Charge: " <<"$"<<charge<<".00"<<"endl;

if ((hours == 9&&mins>=30) (hours>9&&hours<15) (hours==15&&mins<30))
{cout<<"n\n>Please Note:Flight leaves at 16:00."endl
<<" Reporting Time is 15:30!\n\n\n";
}

if(hours<9&&option==2)
{
cout<<"\n\n>Please Note:Flight leaves at 10:00."<<endl
<<" Reporting Time is 09:30!n\n\n";
}
}
int main()
{
int hours,mins,option1;
string name,seat,type,First,Business,Economy;
float charge;

cout<<"t*************";
cout<<"\n\t Welcome To Northern Airlines"<<endl
<<"t*************";
cout<<"\n\n To reserve your seat"<<endl
<<"Please enter your name:";
getline(cin,name);
cout<<"\n Please enter current time as follows:"<<endl
<<"hours:";
cin>>hours;
cout<<"minutes:";
cin>>mins;

option=get_option(hours,mins);
option1=flight(option);
system("cls");
seat= seats (option1);
type=travel(option1);
charge=get_charge(option1);
system("cls");

if(hours<=15)
{
Print_Boarding_Pass(name,seat,type,charge,hours,mins,option);
}

system ("pause")
return 0;
}
I would recommend using file input and output instead of an array, that way the seat allocations aren't erased after closing the executable.
This code will not even compile. Do you want help in fixing the compilation errors or logical errors?

In case you need help in logical errors, post a code which would compile, put them in code tags for better readability. Most of the people won't understand what's going on here.

PS: you need to improve how to write code. Give spaces between different entities. like
if(a < 9 && b > 10) instead of this if(a<9&&b>10)

Write proper conditional spaces with indents and curly braces. improper indented code is nightmare to understand. like
1
2
3
4
if(hours <= 15)
{
	Print_Boarding_Pass(name,seat,type,charge,hours,mins,option);
}


Don't unnecessarily give newline (enter) in the code. like this:
1
2
cout<<"\n\n>Please Note:Flight leaves at 10:00."<<endl
<<" Reporting Time is 09:30!n\n\n";


what are you trying to do here:
1
2
3
4
5
6
7
8
9
10
11
12
13
options
{
1.
cout<<"\n\n\t**First Class**"<<endl
<<"\t-------"<<endl<<endl;
cout<<"seats available:\n\n\t";
2.
cout<<"\n\n\t** Business Class**"<<endl
<<"t------"<<endl<<endl;
cout<<"Seats Available:\n\n\t;
3.
cout<<"\n\n\t**Economy Class**"<<endl
<<"\
cout<<Seats available:\n\n\t";

Last edited on
Can you help me fix both the logical and compilation errors??
the other part which you are asking is for allocating seats.. I would be very grateful if you could help me with this so that I can learn this and use the same knowledge in solving other problems like this.
Last edited on
How about you edit your post, select all the code (Ctrl-A) then press the <> button on the right under format.

If successful it should look like the code in writetonsharma's post.

If only posting a snippet, then put [ code firstline=100] as the opening code tag say, so that the line numbers match up with your code & the compile errors.

Always do this when you post code, it makes it easier for us to look at & we can quote line numbers.

Next, if you have compile errors, post them in full so we can see which line numbers they refer to.

You might get more help if you do this.

Cheers :)
We can help fix both.

First post what I have already told you to do and TheIdeasMan. :-)
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
]#include <iostream>
#include <string>
#include <ctime>
using namespace std;

int option(int hours,int mins)
{
    int option;
    if(hours>=15)
{
    cout <<"sorry its too late to make any bookings today!"<<endl;
         <<"Please come back tomorrow."<<endl<<endl<<endl;
         system ("pause");
         return 0;
}

if (hours==9&&mins>=30)(hours>9&&hours<15)(hours==15&&mins<30))

{
      cout<<"\n Flight FL620 available will depart at 16:00"<<endl
      cin>>endl;
      return 0;
}
      if hours<=9)
{
      cout<<"\nYou have two flights available"<<endl
      <<"FL600 departing at 10:00....FL620 departing at 16:00"<<endl
      <<"\choose a flight:"<<endl
      <<"press '1' for FL600."<<endl
      <<"press '2' for FL620."<<endl;
      cin>>option;
      
      if (option=='1')
      {cout<<"\You have chosen flight FL600"<<endl;]\}
      if  (option == '2')
      {cout<<"\n You have chosen flight FL620"<<endl;}
      return option;
      }
}
      int rows =4;
      int columns=5;
      size=20;
      char seat[rows] [columns]
      
   int main()
{
      for (int i=0;i<5;i++)
      for (int j=0;i<4;i++)
      seat [i][j]="o";
}
   void menu()
{
      cout<<"welcome to northern airlines\n";
      cout<<"please enter one of the following\n";
      cout<<" 1. First Class\n";
      cout<<" 2. Business Class\n";
      cout<<" 3. Economy Class\n";
      cin>>menu;
      
      return menu;
}
      string seats
{
      seats[20]={"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"};
      string seats;
      
      options
{
      1.
      cout<<"\n\n\t**First Class**"<<endl
      <<"\t-------"<<endl<<endl;
      cout<<"seats available:\n\n\t";
      
      for (int i=0;i<5;i++)
      cout<<seat(4)<<seats[i]
      cout<<"\n\n Choose your seat:"endl
          <<"(eg:1,3)\n";
      cin>>seat
      break;
      
      2.
      cout<<"\n\n\t** Business Class**"<<endl
          <<"t------"<<endl<<endl;
      cout<<"Seats Available:\n\n\t;
      
      for (int i=5;i<10;i++)
      cout<<seats(4)seats[i];
      
      cout<<"\n\n Please choose your seat:"<<endl
          <<"(eg.7,9)\n";
          cin>>seat;
          break;
          
      3.
      cout<<"\n\n\t**Economy Class**"<<endl
          <<"\
          cout<<Seats available:\n\n\t";
          
          for (int i=10;i<20<i++)
          cout<<seats(4)<<seats[i];
          
      cout<<"\n\n Please choose a seat:"<<endl
          <<"(eg. 12,15)\n";
          cin>>seat;
      }
      return seat;
}
      float get_charge
      
{
      float charge;
      if(option1==1)
      {charge=800.00;}
      if(option1==2)
      {charge=400.00;}
      if(option1==3)
      {charge=600;}
      return charge;
}

string travel(int option1)
{
       string type;
       if(option 1==1)
       {type="First";}
       
       
       if(option 1==2)
       {type = "Business";}
       
       if(option 1==3)
       {type ="Econom";}
       
       return type;
       }
       
       void print_Boarding_Pass
{
       cout<<"\t           "<<endl
           <<"\t Boarding Pass"<<endl
           <<"\t Passenger Name: "name<<.<<endl<<endl
           <<"\t Seat Number:  "<<seat<<.<<endl<<endl
           <<"t Class:         "<<type<<"Class."<<endl<<endl
           <<"\t Flight Charge: " <<"$"<<charge<<".00"<<"endl;
           
           if ((hours == 9&&mins>=30) (hours>9&&hours<15) (hours==15&&mins<30))
           {cout<<"n\n>Please Note:Flight leaves at 16:00."endl
                <<"      Reporting Time is 15:30!\n\n\n";
}

if(hours<9&&option==2)
{
    cout<<"\n\n>Please Note:Flight leaves at 10:00."<<endl
        <<"          Reporting Time is 09:30!n\n\n";
        }
}
   int main()
   {
       int hours,mins,option1;
       string name,seat,type,First,Business,Economy;
       float charge;
       
       cout<<"t*************";
       cout<<"\n\t Welcome To Northern Airlines"<<endl
           <<"t*************";
       cout<<"\n\n To reserve your seat"<<endl
           <<"Please enter your name:";
       getline(cin,name);
       cout<<"\n Please enter current time as follows:"<<endl
           <<"hours:";
       cin>>hours;
       cout<<"minutes:";
       cin>>mins;
       
       option=get_option(hours,mins);
       option1=flight(option);
       system("cls");
       seat= seats (option1);
       type=travel(option1);
       charge=get_charge(option1);
       system("cls");
       
       if(hours<=15)
{
       Print_Boarding_Pass(name,seat,type,charge,hours,mins,option);
       }
       
       system ("pause")
       return 0;
       }




sorry whatever you guys said I did it...cant get any further
I want to ask, if you wrote this code ?
I am asking because you are not able to fix very basic compilation errors. like these

]#include <iostream>

1
2
3
4
1.
cout<<"\n\n\t**First Class**"<<endl
<<"\t-------"<<endl<<endl;
cout<<"seats available:\n\n\t";


if hours<=9)

char seat[rows] [columns]

1
2
float get_charge
{


if (hours==9&&mins>=30)(hours>9&&hours<15)(hours==15&&mins<30))

Also, you have not done other things which I have asked you to do:

- indentation and spaces and other things mentioned in the last post;
1
2
if (option=='1')
      {cout<<"\You have chosen flight FL600"<<endl;]\}



Don't get me wrong or anything. No one here is going to help you if you don't try to help yourself. Also, here we try to help in such a way that you learn programming rather than just fix everything for you. If I just fix everything, you are not going to learn anything.

So, if you have written the code yourself, scan each line and see what all errors you can fix. If you have not written this code yourself, start with small code. This will give you a good learning curve.

What I said about the first line numbers only applies if you were posting part of the code (I didn't mean for you do this literally with the 100), seen as you are trying to post all of it, just select the code & press the <> button.

Does your IDE have any options to format code? Most of them do - make use of it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
[code first line = 100]
#include <iostream>
#include <string>
#include <ctime>
using namespace std;

int option ( int hours, int mins)
{
    int option;
    if (hours>=15)
{
    cout <<"sorry its too late to make any bookings today!"<<endl;
         <<"Please come back tomorrow."<<endl<<endl<<endl;
         system ("pause");
         return 0;
}

if (hours==9&&mins>=30)||(hours>9&&hours<15)||(hours==15&&mins<30))

{
      cout<<"\n Flight FL620 available will depart at 16:00"<<endl
      cin>>endl;
      return 0;
}
      if (hours<=9)
{
      cout<<"\nYou have two flights available"<<endl
      <<"FL600 departing at 10:00....FL620 departing at 16:00"<<endl
      <<"\choose a flight:"<<endl
      <<"press '1' for FL600."<<endl
      <<"press '2' for FL620."<<endl;
      cin>>option;
      
      if (option=='1')
      {cout<<"\You have chosen flight FL600"<<endl;}
      if  (option == '2')
      {cout<<"\n You have chosen flight FL620"<<endl;}
      return option;
      }
}
      int rows =4;
      int columns=5;
      size = 20;
      char seat [rows] [columns]
      
   int main()
{
      for (int i=0;i<5;i++)
      for (int j=0;i<4;i++)
      seat [i] [j] = "o";
}
   void menu()
{
      cout<<"welcome to northern airlines\n";
      cout<<"please enter one of the following\n";
      cout<<" 1. First Class\n";
      cout<<" 2. Business Class\n";
      cout<<" 3. Economy Class\n";
      cin>>menu;
      
      return menu;
}
      string seats
{
      seats[20]={"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"};
      string seats;
      
      seat options
{
      1.
      cout<<"\n\n\t**First Class**"<<endl
      <<"\t-------"<<endl<<endl;
      cout<<"seats available:\n\n\t";
      
      for (int i=0;i<5;i++)
      cout<<seat (4)<<seat [i]
      cout<<"\n\n Choose your seat:"endl
          <<"(eg:1,3)\n";
      cin>>seat
      break;
      
      2.
      cout<<"\n\n\t** Business Class**"<<endl
          <<"t------"<<endl<<endl;
      cout<<"Seats Available:\n\n\t;
      
      for (int i=5;i<10;i++)
      cout<<seats [4]<<seats [i];
      
      cout<<"\n\n Please choose your seat:"<<endl
          <<"(eg.7,9)\n";
          cin>>seat;
          break;
          
      3.
      cout<<"\n\n\t**Economy Class**"<<endl
          <<"\
          cout<<Seats available:\n\n\t";
          
          for (int i=10;i<20<i++)
          cout<<seats[4]<<seats[i];
          
      cout<<"\n\n Please choose a seat:"<<endl
          <<"(eg. 12,15)\n";
          cin>>seat;
      }
      return seat;
}
      
{
      float_charge;
      if(option1=='1')
      {charge=800.00;}
      if(option1=='2')
      {charge=400.00;}
      if(option1=='3')
      {charge=600;}
      return charge;
}

string travel(int option1)
{
       string type;
       if(option 1=='1')
       {type="First";}
       
       
       if(option 1=='2')
       {type = "Business";}
       
       if(option 1==3)
       {type ="Economy";}
       
       return type;
       }
       
       void print_Boarding_Pass
{
       cout<<"\t_________"<<endl
           <<"\t Boarding Pass"<<endl
           <<"\t Passenger Name: "name<<.<<endl<<endl
           <<"\t Seat Number:  "<<seat<<.<<endl<<endl
           <<"t Class:________"<<type<<"Class."<<endl<<endl
           <<"\t Flight Charge: " <<"$"<<charge<<".00"<<"endl;
           
           if ((hours == 9&&mins>=30) (hours>9&&hours<15) (hours==15&&mins<30))
           {cout<<"n\n>Please Note:Flight leaves at 16:00."endl
                <<"      Reporting Time is 15:30!\n\n\n";
}

if(hours<9&&option==2)
{
    cout<<"\n\n>Please Note:Flight leaves at 10:00."<<endl
        <<" ___________Reporting Time is 09:30!n\n\n";
        }
}
   int main()
   {
       int hours,minutes,option1;
       string name, seat, type, First, Business, Economy;
       float charge;
       
       cout<<"t*************";
       cout<<"\n\t Welcome To Northern Airlines"<<endl
           <<"t*************";
       cout<<"\n\n To reserve your seat"<<endl
           <<"Please enter your name:";
       getline(cin,name);
       cout<<"\n Please enter current time as follows:"<<endl
           <<"hours:";
       cin>>hours;
       cout<<"minutes:";
       cin>>mins;
       
       option = (hours,mins);
       option 1. = flight(option);
       system("cls");
       seat= seats (option 1);
       type=travel(option 1);
       charge=get_charge(option1);
       system("cls");
       
       if (hours<=15)
{
       Print_Boarding_Pass (name, seat, type, charge, hours, mins, option);
       }
       
       system ("pause")
       return 0;
       }


is it fine now or do I have to edit some more[/code]
Last edited on
Except the second half is quoted & get rid of the first line "[code first line = 100]"

Here are the instructions again:

- use the code formatter in your IDE
- start a new post
- paste your code into the new post
- Press Ctrl-A to select all of it
- Press the <> buton
- Submit the post
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#include <iostream>
#include <string>
#include <ctime>
using namespace std;

int option ( int hours, int mins)
{
    int option;
    if (hours>=15)
{
    cout <<"sorry its too late to make any bookings today!"<<endl;
         <<"Please come back tomorrow."<<endl<<endl<<endl;
         system ("pause");
         return 0;
}

if (hours==9&&mins>=30)||(hours>9&&hours<15)||(hours==15&&mins<30))

{
      cout<<"\n Flight FL620 available will depart at 16:00"<<endl
      cin>>endl;
      return 0;
}
      if (hours<=9)
{
      cout<<"\nYou have two flights available"<<endl
      <<"FL600 departing at 10:00....FL620 departing at 16:00"<<endl
      <<"\choose a flight:"<<endl
      <<"press '1' for FL600."<<endl
      <<"press '2' for FL620."<<endl;
      cin>>option;
      
      if (option=='1')
      {cout<<"\You have chosen flight FL600"<<endl;}
      if  (option == '2')
      {cout<<"\n You have chosen flight FL620"<<endl;}
      return option;
      }
}
      int rows =4;
      int columns=5;
      size = 20;
      char seat [rows] [columns]
      
   int main()
{
      for (int i=0;i<5;i++)
      for (int j=0;i<4;i++)
      seat [i] [j] = "o";
}
   void menu()
{
      cout<<"welcome to northern airlines\n";
      cout<<"please enter one of the following\n";
      cout<<" 1. First Class\n";
      cout<<" 2. Business Class\n";
      cout<<" 3. Economy Class\n";
      cin>>menu;
      
      return menu;
}
      string seats
{
      seats[20]={"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"};
      string seats;
      
      seat options
{
      1.
      cout<<"\n\n\t**First Class**"<<endl
      <<"\t-------"<<endl<<endl;
      cout<<"seats available:\n\n\t";
      
      for (int i=0;i<5;i++)
      cout<<seat (4)<<seat [i]
      cout<<"\n\n Choose your seat:"endl
          <<"(eg:1,3)\n";
      cin>>seat
      break;
      
      2.
      cout<<"\n\n\t** Business Class**"<<endl
          <<"t------"<<endl<<endl;
      cout<<"Seats Available:\n\n\t;
      
      for (int i=5;i<10;i++)
      cout<<seats [4]<<seats [i];
      
      cout<<"\n\n Please choose your seat:"<<endl
          <<"(eg.7,9)\n";
          cin>>seat;
          break;
          
      3.
      cout<<"\n\n\t**Economy Class**"<<endl
          <<"\
           cout<<Seats available:\n\n\t";
          
          for (int i=10;i<20<i++)
          cout<<seats[4]<<seats[i];
          
      cout<<"\n\n Please choose a seat:"<<endl
          <<"(eg. 12,15)\n";
          cin>>seat;
      }
      return seat;
}
      
{
      float_charge;
      if(option1=='1')
      {charge=800.00;}
      if(option1=='2')
      {charge=400.00;}
      if(option1=='3')
      {charge=600;}
      return charge;
}

string travel(int option1)
{
       string type;
       if(option 1=='1')
       {type="First";}
       
       
       if(option 1=='2')
       {type = "Business";}
       
       if(option 1==3)
       {type ="Economy";}
       
       return type;
       }
       
       void print_Boarding_Pass
{
       cout<<"\t_________"<<endl
           <<"\t Boarding Pass"<<endl
           <<"\t Passenger Name: "name<<.<<endl<<endl
           <<"\t Seat Number:  "<<seat<<.<<endl<<endl
           <<"t Class:________"<<type<<"Class."<<endl<<endl
           <<"\t Flight Charge: " <<"$"<<charge<<".00"<<"endl;
           
           if ((hours == 9&&mins>=30) (hours>9&&hours<15) (hours==15&&mins<30))
           {cout<<"n\n>Please Note:Flight leaves at 16:00."endl
                <<"      Reporting Time is 15:30!\n\n\n";
}

if(hours<9&&option==2)
{
    cout<<"\n\n>Please Note:Flight leaves at 10:00."<<endl
        <<" ___________Reporting Time is 09:30!n\n\n";
        }
}
   int main()
   {
       int hours,minutes,option1;
       string name, seat, type, First, Business, Economy;
       float charge;
       
       cout<<"t*************";
       cout<<"\n\t Welcome To Northern Airlines"<<endl
           <<"t*************";
       cout<<"\n\n To reserve your seat"<<endl
           <<"Please enter your name:";
       getline(cin,name);
       cout<<"\n Please enter current time as follows:"<<endl
           <<"hours:";
       cin>>hours;
       cout<<"minutes:";
       cin>>mins;
       
       option = (hours,mins);
       option 1. = flight(option);
       system("cls");
       seat= seats (option 1);
       type=travel(option 1);
       charge=get_charge(option1);
       system("cls");
       
       if (hours<=15)
{
       Print_Boarding_Pass (name, seat, type, charge, hours, mins, option);
       }
       
       system ("pause")
       return 0;
       }
What problem? Is the most recent code you posted not working? In what way is it not working?

We can't read your mind.
@Rae

I am beginning to think you are trolling - it took 14 posts to get code tags, the code is full of ridiculous errors. Not just mistakes, but thoroughly ignorant ones. And you haven't made bit of effort.

Don't continually whine for help, - show some initiative, or I will report you for trolling.
Thats why I stopped replying.. OP didn't even try once to see what I am saying...
Look at my posts above.. silly errors.. and I am sure its not OP's code and just copied from somewhere.. what a waste of time!!!

@MikeyBoy - Just have a quick look and you will see what is not working. Nothing is working here. The first post and the last post, code is same after helping so much.

I wonder who has reported @TheIdeasMan ?

I quit.
Last edited on
I don't care if someone reports me - I stand behind what I have said 100%. If the OP proves me wrong, then I can apologise.

So now I have reported the OP, I wonder which account admin will restrict or close?

Edit: It seems my reporting of the OP has, removed the post, maybe the rules have changed - it used to only do that when the user had less than about 5 posts.

Last edited on
Topic archived. No new replies allowed.