| | |
C++ URGENT HELP PLZ PLZ PLZ help me
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2009
Posts: 6
Reputation:
Solved Threads: 0
PLEASE EDIT this code if u can .
this is my c++ Assgnment it is about reserving air tickets.
if u can help me 2 insert delete & Edit a air ticket functions to the main menu please please please help me my friendz...
I wz managed 2 save d details in a txt file but i need 2 edit & delete the text file please help me ..& i need 2 insert edit the file & delete the file into d main menu please help me..I hav 2 submit tis on 28 morning plz help me if u can
this is my c++ Assgnment it is about reserving air tickets.
if u can help me 2 insert delete & Edit a air ticket functions to the main menu please please please help me my friendz...
I wz managed 2 save d details in a txt file but i need 2 edit & delete the text file please help me ..& i need 2 insert edit the file & delete the file into d main menu please help me..I hav 2 submit tis on 28 morning plz help me if u can
C++ Syntax (Toggle Plain Text)
# include<iostream> #include<string> #include<windows.h> #include<fstream> using namespace std; ofstream outf("ticket.txt"); int selct; char ch; class passenger{ public: int age,idno,routeno; double tic,tic3,tic5; string to,name,sex; public: void ticketprice(){ cout<<" (1) WATCH PRICES "<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"-----------------------------------------------------------------------------"<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<" Route - Economy class - Business class "<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cout<<"-----------------------------------------------------------------------------"<<endl; cout<<"- Colombo - - -"<<endl; cout<<"- to - 070,000 - 086,100 -"<<endl; cout<<"- Washington - - -"<<endl; cout<<"-----------------------------------------------------------------------------"<<endl; cout<<"- Colombo - - -"<<endl; cout<<"- to - 080,000 - 098,400 -"<<endl; cout<<"- Paris - - -"<<endl; cout<<"-----------------------------------------------------------------------------"<<endl; cout<<"- Colombo - - -"<<endl; cout<<"- to - 050,000 - 061,500 -"<<endl; cout<<"- London - - -"<<endl; cout<<"-----------------------------------------------------------------------------"<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12); cout<<""<<endl; cout<<""<<endl; cout<<" ============ "<<endl; cout<<" = NOTICE = "<<endl; cout<<" ============ "<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cout<<"*****************************************************************"<<endl; cout<<"** **IF (AGE <4) 50% DISCOUNT ON THEIR TICKET **"<<endl; cout<<" **"<<endl; cout<<""<<endl; cout<<"** **IF (4 <AGE<15) 25% DISCOUNT ON THEIR TICKET **"<<endl; cout<<" **"<<endl; cout<<" **"<<endl; cout<<"** **IF (15 <AGE<18) 10% DISCOUNT ON THEIR TICKET **"<<endl; cout<<"*****************************************************************"<<endl; } void getdata(){ cout<<" (2) RESERVE A TICKET "<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12); cout<<"******************************************************************************"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<"** PLEASE ENTER YOUR NAME HERE : "; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cin>>name; outf<<"PASSENGER'S NAME IS : "<<name<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<"** PLEASE ENTER YOUR SEX HERE (male/female) : "; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cin>>sex; outf<<"SEX OF THE PASSENGER : "<<sex<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<"** PLEASE ENTER YOUR AGE HERE : "; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cin>>age; outf<<"PASSENGER'S AGE IS : "<<age<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<"** PLEASE ENTER YOUR IDENTITY CARD NUMBER HERE : "; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cin>>idno; outf<<"PASSENGER'S IDENTITY CARD NUMBER IS :"<<idno<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12); cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"******************************************************************************"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cout<<" *********************************"<<endl; cout<<" *********************************"<<endl; cout<<" ** (1) Economic Class **"<<endl; cout<<" ** **"<<endl; cout<<" ** (2) Business Class **"<<endl; cout<<" *********************************"<<endl; cout<<" *********************************"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"Please select one of the above selections :- "; cin>>selct; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cout<<" The Available Destinations are"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<" #####################################"<<endl; cout<<" ### ###"<<endl; cout<<" ### 1 - Colombo to Washington ###"<<endl; cout<<" ### 2 - Colombo to Paris ###"<<endl; cout<<" ### 3 - Colombo to London ###"<<endl; cout<<" ### ###"<<endl; cout<<" #####################################"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"Please select one of the above route numbers :-"; cin>>routeno; } double calticprice(){ if(routeno==1){ tic=70000; } else if (routeno==2){ tic=80000; } else if(routeno==3){ tic=50000; } return tic; } void calage(){ double tic2=tic; if(age<=4){ tic3=(tic2*50)/100; } else if((age>5)&&(age<=15)){ tic3=(tic2*75)/100; } else if((age>16)&&(age<18)){ tic3=(tic2*90)/100; } else{ tic3=tic2; } } void display(){ system("cls"); cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<" TICKET DETAILS "<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cout<<"%%% NAME OF THE CUSTOMER :"<<name<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"%%% AGE OF THE CUSTOMER :"<<age<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"%%% NIC OF THE CUSTOMER :"<<idno<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"%%% SEAT NUMBER OF THE CUTOMER :"<<seatnum<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"THE FLIGHT NUMBER IS : FL110 "<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"YOUR RESERVED DATE IS : 2009 10 28"<<endl; cout<<""<<endl; if(selct==1){ cout<<"TICKET PRICE :"<<tic3<<endl; } else if(selct==2){ cout<<"TICKET PRICE :"<<tic5<<endl; } cout<<"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"<<endl; } void seatnum(){ int seat; int seatnum=0; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"DETAILS OF YOUR TICKET HAS BEEN SUCCESSFULLY UPDATED TO OUR COMPANY "<<endl; cout<<" FINALLY PLEASE ENTER THE SEAT NUMBER - "; cin>>seat; cout<<endl; if(seatnum!=seat){ seatnum=seat; cout<<"SUCCESSFUL"<<endl; } else{ cout<<"SORRY"<<endl; if(seatnum!=seat){ seatnum=seat; cout<<"SUCCESSFUL"<<endl; } } } }; class economic:public passenger{ public: void getdata(){ passenger::getdata(); } void calticprice2(){ passenger::calticprice(); } void seatnum(){ passenger::seatnum(); } }; class business:public passenger{ public: void getdata(){ passenger::getdata(); } void calticprice3(){ passenger::calticprice(); double tic4=tic; if(age<=4){ tic5=(tic4*123/100)*50/100; } else if((age>=5)&&(age<=15)){ tic5=(tic4*123/100)*75/100; } else if((age>16)&&(age<18)){ tic5=(tic4*123/100)*90/100; } else{ tic5=(tic4*123)/100; } } void seatnum(){ passenger::seatnum(); } }; //void seatnum(); int main(){ int menuselect; char c; passenger p1; do{ system("cls"); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10); cout<<"******************************************************************************"<<endl; cout<<"* *"<<endl; cout<<"* WELCOME TO THE TRAVEL LINE AIRLINE TRANSPORTATION COMPANY *"<<endl; cout<<"* *"<<endl; cout<<"* TICKET RESERVATION PROGRAM *"<<endl; cout<<"* *"<<endl; cout<<"* *"<<endl; cout<<"******************************************************************************"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; cout<<"~~~~~ MAIN MENU ~~~~"<<endl; cout<<"~~~~~ ~~~~"<<endl; cout<<"~~~~~ (1) Watch the prices ~~~~"<<endl; cout<<"~~~~~ ~~~~"<<endl; cout<<"~~~~~ (2) Reserve a ticket ~~~~"<<endl; cout<<"~~~~~ ~~~~"<<endl; cout<<"~~~~~ ~~~~"<<endl; cout<<"~~~~~ ~~~~"<<endl; cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"Please select one of the above selections :-"; cin>>menuselect; if(menuselect==1){ system("cls"); p1.ticketprice(); cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"do u want to Reserve a ticket(y/n)"; cin>>c; if(c=='y') { system("cls"); p1.getdata(); p1.calticprice(); p1.calage(); p1.seatnum(); p1.display(); } else if(c=='n'){ cout<<"Thank you Very much for using our travelline ticket reservation program good bye"<<endl; system("cls"); } } else if(menuselect==2){ system("cls"); if(selct=1){ //case 1: economic e1; e1.getdata(); e1.calticprice2(); e1.calage(); e1.seatnum(); e1.display(); //break; } else if(selct=2){ business b1; b1.getdata(); b1.calticprice3(); b1.calage(); b1.seatnum(); b1.display(); //break; } else{ cout<<"Invalid selection"<<endl; } //} //else if(select==2){ } cout<<"DO U WANT TO CONTINUE?(y/n) "; cin>>ch; }while(ch!='n'); return 0; }
Last edited by Ancient Dragon; Jul 26th, 2009 at 9:41 am. Reason: add code tags
•
•
Join Date: Feb 2008
Posts: 634
Reputation:
Solved Threads: 46
You cannot just post a bunch of code and expect us to do your assignment.
1) use code tags so the code you do post is readable
2) extract the problem you are having in to the smallest example possible ( < 20 lines) with sample input, expected output, current (incorrect) output, and any errors that are generated)
1) use code tags so the code you do post is readable
2) extract the problem you are having in to the smallest example possible ( < 20 lines) with sample input, expected output, current (incorrect) output, and any errors that are generated)
•
•
Join Date: Jul 2009
Posts: 6
Reputation:
Solved Threads: 0
bro
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"~~~~~ MAIN MENU ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~ (1) Watch the prices ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~ (2) Reserve a ticket ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
this is the main menu plz if u can add delete & edit items to this one refer ma code please plz plz plz
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"~~~~~ MAIN MENU ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~ (1) Watch the prices ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~ (2) Reserve a ticket ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
this is the main menu plz if u can add delete & edit items to this one refer ma code please plz plz plz
•
•
Join Date: Jan 2008
Posts: 3,829
Reputation:
Solved Threads: 501
•
•
•
•
bro
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"~~~~~ MAIN MENU ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~ (1) Watch the prices ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~ (2) Reserve a ticket ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~ ~~~~"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
this is the main menu plz if u can add delete & edit items to this one refer ma code please plz plz plz
Code tags. Read Salem's links regarding how. What exactly do you want? Add some cout statements for "delete" and "edit" to the menu above. No one is going to go through your first post without line numbered C++ code tags.
[code=cplusplus]
// paste code here
[/code]
You need to ask a specific question using clear English and point us towards specific line numbers. Anything sounding like "Do this for me..." is going to be ignored by most people.
•
•
•
•
Code tags. Read Salem's links regarding how. What exactly do you want? Add some cout statements for "delete" and "edit" to the menu above. No one is going to go through your first post without line numbered C++ code tags.
[code=cplusplus]
// paste code here
[/code]
C++ Syntax (Toggle Plain Text)
# include<iostream> #include<string> #include<windows.h> #include<fstream> using namespace std; ofstream outf("ticket.txt"); int selct; char ch; class passenger{ public: int age,idno,routeno; double tic,tic3,tic5; string to,name,sex; public: void ticketprice(){ cout<<" (1) WATCH PRICES "<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"-----------------------------------------------------------------------------"<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<" Route - Economy class - Business class "<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cout<<"-----------------------------------------------------------------------------"<<endl; cout<<"- Colombo - - -"<<endl; cout<<"- to - 070,000 - 086,100 -"<<endl; cout<<"- Washington - - -"<<endl; cout<<"-----------------------------------------------------------------------------"<<endl; cout<<"- Colombo - - -"<<endl; cout<<"- to - 080,000 - 098,400 -"<<endl; cout<<"- Paris - - -"<<endl; cout<<"-----------------------------------------------------------------------------"<<endl; cout<<"- Colombo - - -"<<endl; cout<<"- to - 050,000 - 061,500 -"<<endl; cout<<"- London - - -"<<endl; cout<<"-----------------------------------------------------------------------------"<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12); cout<<""<<endl; cout<<""<<endl; cout<<" ============ "<<endl; cout<<" = NOTICE = "<<endl; cout<<" ============ "<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cout<<"*****************************************************************"<<endl; cout<<"** **IF (AGE <4) 50% DISCOUNT ON THEIR TICKET **"<<endl; cout<<" **"<<endl; cout<<""<<endl; cout<<"** **IF (4 <AGE<15) 25% DISCOUNT ON THEIR TICKET **"<<endl; cout<<" **"<<endl; cout<<" **"<<endl; cout<<"** **IF (15 <AGE<18) 10% DISCOUNT ON THEIR TICKET **"<<endl; cout<<"*****************************************************************"<<endl; } void getdata(){ cout<<" (2) RESERVE A TICKET "<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12); cout<<"******************************************************************************"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<"** PLEASE ENTER YOUR NAME HERE : "; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cin>>name; outf<<"PASSENGER'S NAME IS : "<<name<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<"** PLEASE ENTER YOUR SEX HERE (male/female) : "; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cin>>sex; outf<<"SEX OF THE PASSENGER : "<<sex<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<"** PLEASE ENTER YOUR AGE HERE : "; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cin>>age; outf<<"PASSENGER'S AGE IS : "<<age<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<"** PLEASE ENTER YOUR IDENTITY CARD NUMBER HERE : "; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cin>>idno; outf<<"PASSENGER'S IDENTITY CARD NUMBER IS :"<<idno<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12); cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"******************************************************************************"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cout<<" *********************************"<<endl; cout<<" *********************************"<<endl; cout<<" ** (1) Economic Class **"<<endl; cout<<" ** **"<<endl; cout<<" ** (2) Business Class **"<<endl; cout<<" *********************************"<<endl; cout<<" *********************************"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"Please select one of the above selections :- "; cin>>selct; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cout<<" The Available Destinations are"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<" #####################################"<<endl; cout<<" ### ###"<<endl; cout<<" ### 1 - Colombo to Washington ###"<<endl; cout<<" ### 2 - Colombo to Paris ###"<<endl; cout<<" ### 3 - Colombo to London ###"<<endl; cout<<" ### ###"<<endl; cout<<" #####################################"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"Please select one of the above route numbers :-"; cin>>routeno; } double calticprice(){ if(routeno==1){ tic=70000; } else if (routeno==2){ tic=80000; } else if(routeno==3){ tic=50000; } return tic; } void calage(){ double tic2=tic; if(age<=4){ tic3=(tic2*50)/100; } else if((age>5)&&(age<=15)){ tic3=(tic2*75)/100; } else if((age>16)&&(age<18)){ tic3=(tic2*90)/100; } else{ tic3=tic2; } } void display(){ system("cls"); cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<" TICKET DETAILS "<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cout<<"%%% NAME OF THE CUSTOMER :"<<name<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"%%% AGE OF THE CUSTOMER :"<<age<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"%%% NIC OF THE CUSTOMER :"<<idno<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"%%% SEAT NUMBER OF THE CUTOMER :"<<seatnum<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"THE FLIGHT NUMBER IS : FL110 "<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"YOUR RESERVED DATE IS : 2009 10 28"<<endl; cout<<""<<endl; if(selct==1){ cout<<"TICKET PRICE :"<<tic3<<endl; } else if(selct==2){ cout<<"TICKET PRICE :"<<tic5<<endl; } cout<<"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"<<endl; } void seatnum(){ int seat; int seatnum=0; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"DETAILS OF YOUR TICKET HAS BEEN SUCCESSFULLY UPDATED TO OUR COMPANY "<<endl; cout<<" FINALLY PLEASE ENTER THE SEAT NUMBER - "; cin>>seat; cout<<endl; if(seatnum!=seat){ seatnum=seat; cout<<"SUCCESSFUL"<<endl; } else{ cout<<"SORRY"<<endl; if(seatnum!=seat){ seatnum=seat; cout<<"SUCCESSFUL"<<endl; } } } }; class economic:public passenger{ public: void getdata(){ passenger::getdata(); } void calticprice2(){ passenger::calticprice(); } void seatnum(){ passenger::seatnum(); } }; class business:public passenger{ public: void getdata(){ passenger::getdata(); } void calticprice3(){ passenger::calticprice(); double tic4=tic; if(age<=4){ tic5=(tic4*123/100)*50/100; } else if((age>=5)&&(age<=15)){ tic5=(tic4*123/100)*75/100; } else if((age>16)&&(age<18)){ tic5=(tic4*123/100)*90/100; } else{ tic5=(tic4*123)/100; } } void seatnum(){ passenger::seatnum(); } }; //void seatnum(); int main(){ int menuselect; char c; passenger p1; do{ system("cls"); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10); cout<<"******************************************************************************"<<endl; cout<<"* *"<<endl; cout<<"* WELCOME TO THE TRAVEL LINE AIRLINE TRANSPORTATION COMPANY *"<<endl; cout<<"* *"<<endl; cout<<"* TICKET RESERVATION PROGRAM *"<<endl; cout<<"* *"<<endl; cout<<"* *"<<endl; cout<<"******************************************************************************"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14); cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; cout<<"~~~~~ MAIN MENU ~~~~"<<endl; cout<<"~~~~~ ~~~~"<<endl; cout<<"~~~~~ (1) Watch the prices ~~~~"<<endl; cout<<"~~~~~ ~~~~"<<endl; cout<<"~~~~~ (2) Reserve a ticket ~~~~"<<endl; cout<<"~~~~~ ~~~~"<<endl; cout<<"~~~~~ ~~~~"<<endl; cout<<"~~~~~ ~~~~"<<endl; cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15); cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"Please select one of the above selections :-"; cin>>menuselect; if(menuselect==1){ system("cls"); p1.ticketprice(); cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<""<<endl; cout<<"do u want to Reserve a ticket(y/n)"; cin>>c; if(c=='y') { system("cls"); p1.getdata(); p1.calticprice(); p1.calage(); p1.seatnum(); p1.display(); } else if(c=='n'){ cout<<"Thank you Very much for using our travelline ticket reservation program good bye"<<endl; system("cls"); } } else if(menuselect==2){ system("cls"); if(selct=1){ //case 1: economic e1; e1.getdata(); e1.calticprice2(); e1.calage(); e1.seatnum(); e1.display(); //break; } else if(selct=2){ business b1; b1.getdata(); b1.calticprice3(); b1.calage(); b1.seatnum(); b1.display(); //break; } else{ cout<<"Invalid selection"<<endl; } //} //else if(select==2){ } cout<<"DO U WANT TO CONTINUE?(y/n) "; cin>>ch; }while(ch!='n'); return 0; }
Atheist: God is man made imagination, he doesn't exist!
Theist: It's okay, can you imagine anything else that doesn't exist?
Junior MD --- Python, C++ and PHP
Theist: It's okay, can you imagine anything else that doesn't exist?
Junior MD --- Python, C++ and PHP
To the OP:
Can't you read? You were asked to use code tags, but what do you do? You just continue to not use them, don't expect much help then.
Information about code tags is found all over the website:
How can you miss these? You have no excuse for not using them.
Your begging and begging and begging is really getting on my nerves, it won't get you anywhere, already bothered to even look at the links in Salem's post? Wait... Let me guess: no. And let me guess again for the reason: you didn't see any code in his post.
You're just another one who just wants us to fix up your screwed code.
Do you really think that we're going fix the code for you? We've better things to do, for example helping people who deserve help, in other words, helping people who are not like you.
To help you I'll give you one magical link which will help you to write code which actually works, here it is...
Can't you read? You were asked to use code tags, but what do you do? You just continue to not use them, don't expect much help then.
Information about code tags is found all over the website:
•
•
•
•
1) in the Rules you were asked to read when you registered
2) in the text at the top of this forum
3) in the announcement at the top of this forum titled Please use BB Code and Inlinecode tags
4) in the sticky post above titled Read Me: Read This Before Posting
5) any place CODE tags were used
6) Even on the background of the box you actually typed your message in!
Your begging and begging and begging is really getting on my nerves, it won't get you anywhere, already bothered to even look at the links in Salem's post? Wait... Let me guess: no. And let me guess again for the reason: you didn't see any code in his post.
You're just another one who just wants us to fix up your screwed code.
Do you really think that we're going fix the code for you? We've better things to do, for example helping people who deserve help, in other words, helping people who are not like you.
To help you I'll give you one magical link which will help you to write code which actually works, here it is...
Last edited by tux4life; Jul 26th, 2009 at 6:19 am. Reason: fix some typos, make post enjoyable to read
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
In addition to what tux4life has said, do not use chatroom speak. Use correct, complete English words and sentences as per the forum rules.
Thank you.
Thank you.
![]() |
Similar Threads
- urgent help plz read (C++)
- plz help...urgent (Perl)
- Urgent Help PLZ (Pascal and Delphi)
- Urgent plz help (Pascal and Delphi)
- plz urgent urgent urgent help plz (PHP)
- Dev C++ --> URGENT PLZ (C++)
- searching and paging..plz help.. (ASP)
- Programming help plz! any one can... (C++)
Other Threads in the C++ Forum
- Previous Thread: How retrieve a file from the internet?
- Next Thread: cant overwrite original file
| Thread Tools | Search this Thread |
api application array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg simple sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






