-
Notifications
You must be signed in to change notification settings - Fork 0
/
reservation.cpp
70 lines (66 loc) · 2.07 KB
/
reservation.cpp
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
#include<bits/stdc++.h>
#include "reservation.h"
using namespace std;
void reser :: getRes(){
cout<<"Enter the details as follows\n";
cout<<"Train no: ";
cin>>tno;
cin.ignore();
cout<<"Train name: ";
cin.getline(tname,100);
cout<<"Boarding point: ";
//cin.ignore();
cin.getline(bp,10);
cout<<"Destination pt: ";
//cin.ignore();
cin.getline(dest,100);
cout<<"No of seats required: ";
cin>>nosr;
cin.ignore();
for(i=0; i<nosr ; i++)
{
cout<<"Passenger name: ";
cin.getline(pname[i],100);
cout<<"Passenger age: ";
cin>>age[i];
cin.ignore();
}
cout<<"Enter the class f-first class s-second class: ";
//cin.ignore();
cin.getline(clas,10);
cout<<"Date of travel:";
cin>>d>>m>>y;
cout<<"Enter the concession category\n";
cout<<"1.Military\n2.Senior citizen\n";
cout<<"3.Children below 5 yrs\n4.None\n";
cin>>con;
cout<<"............END OF GETTING DETAILS............\n";
}
void reser:: displayRes(){
cout<<"...............................................\n";
cout<<"...............................................\n";
cout<<"PNR No: "<<pnr;
cout<<"\nTrain no:"<<tno;
cout<<"\nTrain name:";
puts(tname);
cout<<"Boarding point:";
puts(bp);
cout<<"Destination pt:";
puts(dest);
cout<<"No of seats reserved: "<<nosr;
for(i=0; i<nosr; i++)
{ cout<<'\n';
cout<<"Passenger name:";
puts(pname[i]);
cout<<'\t';
cout<<"Passenger age:"<<age[i];
}
cout<<"\nYour class:";
puts(clas);
cout<<"\nDate of reservation:"<<d<<"-"<<m<<"-"<<y;
cout<<"\nYour concession category:"<<con;
cout<<"\nYou must pay:"<<amc<<endl;
cout<<"***********************************************\n";
cout<<".........END OF RESERVATION.................\n";
cout<<"***********************************************\n";
}