Hello..
I'm working on my project.. It's not done yet.. But i wanna debug these errors now first..
Please would someone check them for me.
Thanks..
Here is the interface:
# ifndef MAINMENU_H
# define MAINMENU_H
# include <iostream>
using namespace std;
class MainMenu
{
public:
MainMenu();
MainMenu(string the_name);
MainMenu(string the_destanation, string the_departure, string the_date, string the_time);
friend ostream& operator << (ostream& outs,const MainMenu& settings);
friend istream& operator >> (istream& ins,const MainMenu& settings);
friend void display_main_menu ();
int choose_from_main_menu (int choice);
void JOTAKU_LOGO ()const;
private:
string destanation;
string departure;
string date;
string time;
string name;
};
# endif //MAINMENU_H
Here is the implementation:
# include <iostream>
# include <string>
# include "MainMenu.h"
using namespace std;
MainMenu::MainMenu()
{
destanation="no destanation yet.";
departure="no departure yet.";
date="no date entered yet.";
time="no time yet.";
}
MainMenu(string the_name)
{
name="No name yet.";
}
MainMenu::MainMenu(string the_destanation, string the_departure, string the_date, string the_time)
{
destanation=the_destanation;
departure=the_departure;
date=the_date;
time=the_time;
}
ostream& operator << (ostream& outs,const MainMenu& settings)
{
outs<<settings.departure
<<settings.destanation
<<settings.date
<<settings.time;
return outs;
}
istream& operator >> (istream& ins,const MainMenu& settings)
{
ins >>settings.departure
>>settings.destanation;
return ins;
}
void MainMenu::display_main_menu ()
{
cout<<"Hello "<<Passenger_name<<" and welcome to J-Otaku-Air travel agency."<<endl
<<"Please choose a number from the following menu, then press enter to "
<<"move to the desired page."<<endl<<endl
<<"1. About J-Otaku-Air"<<endl
<<"2. Reservations"<<endl
<<"3. Currency Converter"<<endl
<<"4. Budget Travels & Special Offers"<<endl
<<"5. Frequently asked questions"<<endl
<<"6. Contact us"<<endl
<<"* Press 0 to exit"<<endl<<endl;
cin>>num;
cout<<endl;
}
int MainMenu::choose_from_main_menu (int choice)
{
cin>>choice;
}
void MainMenu::JOTAKU_LOGO () const
{
cout << "\t\t\t ================= "<<endl;
cout << "\t\t\t || || || || "<<endl;
cout << "\t\t\t || || || || "<<endl;
cout << "\t\t\t || || || "<<endl;
cout << "\t\t\t \\ || || "<<endl;
cout << "\t\t\t \\ || "<<endl;
cout << "\t\t\t \\ || "<<endl;
cout << "\t\t\t \\|| J-Otaku-Air "<<endl;
cout <<endl;
cout <<endl;
}
Please provide me with some debuggings.. This is urgent.