Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are to develop a C++ code for an airlines online ticket booking system. The code should be user-friendly to allow the customer to easily

You are to develop a C++ code for an airlines online ticket booking system. The code should be user-friendly to allow the customer to easily initiate a new booking, view his existing booking, or cancel it. On the other hand, the code also allows the airline managers to add or update information on available flights, and perform other clerical tasks (like checking the number of bookings, passenger information, etc.). For simplicity, the code does not need to implement the functionality of a payment (just entering the PAY string is enough). The problem is very open- ended, meaning you can use any of the concepts learnt in the course to implement different additional functionalities to your code (and earn bonus points!). Use concepts like class inheritance, friend classes, constructors, private data, arrays, etc to add better structure to your code. For example, your definitions of Manager and Customer class can inherit from a Person class. The code should fulfill the following functionalities: Have 2 different levels of authentications; Manager and Customer. Both Manager and Customer should have the following attributes: name, user id, and password. Details of all registered users should be saved in a Users excel file. All excel files can be implemented as excel files of mentioned names. Manager: o Manager can sign in and logout only. No sign up required for managers (these users should already exist in the users list). A sample managers name can be Usama Khan and the password is UK1234 o New flights are added to the Flights database by the Managers. The flight information should contain enough attributes to distinctly identify it. o A manager can access information about all flights listed in the system. Customer: o Needs to sign up with a username and password. o Uses the credentials saved at sign up to log in and start a new session. o The session starts with the display of the customer console view, where he can view existing bookings, cancel a booking, or make a new booking. o A new booking is made on the available list of flights. Seats can be booked for multiple passengers in a single booking. All details on a new booking should be saved in the Booking file. o Customer should be able to cancel an existing booking from his console view. Make additional classes, as you deem necessary, to facilitate a proper functioning of the ticket reservation software. Additional points will be awarded to more interactive console screen design.

plz complete the given code according to the above statements.

#include #include #include using namespace std; class person{ string name; int user_id; string password; public: void set_name(){ string n; cout<<"Choose your name from the following list of managers: "<>n;

name=n; }

string get_name(){ return name; } void set_userid(){ int i; cout<<"Enter your id"<>i; user_id=i; } int get_userid(){ return user_id; }

}; class manager: public person{ public: int id; void show(){ if (get_name()=="Ahmed"){

if (get_userid()==1234){ cout<<"Welcome to manager's profile"<

}

} else if (get_name()=="Ajmal"){ if (get_userid()==5678){ cout<<"Welcome to manger's profile"<

} friend void profile();

}; void profile(){ char opt; int op; do{ cout<<"chose the following option"<>op; if(op==1){ ifstream myfile("text.txt"); string st; while (getline (myfile,st )) { // Output the text from the file cout << st<

else if(op==2){ int fl; string DATA,data,Data; ofstream file("text.txt",ios::app); cout<<"Write details about flights you want to add"<

} else if(op==3){

} else if(op==4){

} else cout<<"invalid input"<>opt; }while ( opt == 'y' );

} int main() {

manager m;

m.set_name(); m.set_userid(); m.show(); profile();

return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

ISBN: 1583474013, 978-1583474013

Students also viewed these Databases questions