#include <iostream>
#include <vector>
using namespace std;
int opt_user(){
int input;
cout<<"\n";
cout<<"1.List of the all attractions \n";
cout<<"2.Sports \n";
cout<<"3.Culture \n";
cout<<"4.Shopping \n";
cout<<"Choose the attraction that you want! Enter based on the \n";
cout<<"number that have listed according to the attraction: \n";
cin>>input;
return input;
}
class City{
string name;
int id;
public:
City(int id=0, string name="NULL"):id(id), name(name){}
void setID();
string getName();
int getID();
};
int City::getID(){
return id;
}
string City::getName(){
return name;
}
void City::setID(){
cout<<"The list of Cities according to alphabetical form: /n";
vector<city>city;
city.push_back(City(01, "Georgetown"));
city.push_back(City(02, "Kuala Lumpur"));
city.push_back(City(03, "Malacca"));
for (int i=0; i<city.size();> {
cout<<i+1<<city[i].getName()<<endl;
}
cout<<"Choose a City that you want! Enter based on the number \n";
cout<<"that have listed according to the City: \n";
int x;
string selectCity;
cin>>x;
this->id = x;
selectCity = city[x-1].getName(); this->name = selectCity;
}
class Attraction{
int typeID;
int Att_id;
protected :
string Att_name;
public :
Attraction(int typeID = 0, int Att_id = 0, string Att_name = "NULL"): Att_id(Att_id), typeID(typeID), Att_name(Att_name){}
string get_attName();
virtual int display(int id);
};
int Attraction::display(int id){
cout<<"These are the list of attractions: \n";
if(id == 1){
vector<attraction> Georgetown_Att;
Georgetown_Att.push_back(Attraction(1, 01, "Free Fall & Zip Lining"));
Georgetown_Att.push_back(Attraction(2, 01, "Tree Swings & Water Park"));
Georgetown_Att.push_back(Attraction(3, 02, "Khoo Kongsi Temple"));
Georgetown_Att.push_back(Attraction(4, 02, "Sri Mariamman Temple"));
Georgetown_Att.push_back(Attraction(5, 02, "St. George's Church"));
Georgetown_Att.push_back(Attraction(6, 02, "Kapitan Keling Mosque"));
Georgetown_Att.push_back(Attraction(7, 03, "Prangin Mall"));
Georgetown_Att.push_back(Attraction(8, 03, "1st Avenue Mall"));
for(int i = 0; i < Georgetown_Att.size(); i++)
{
cout << i+1 << ". " << Georgetown_Att[i].get_attName() << endl;
}
int input;
cout<<"Choose the place you want in the form of the decimal \n";
cout<<"number that have listed above: \n";
cin>> input;
cout << "The place you have choose is: " << Georgetown_Att[input-1].get_attName();
return input;
}
else if(id == 2)
{
vector<attraction> KualaLumpur_Att;
KualaLumpur_Att.push_back(Attraction(1, 01, "Bukit Jalil Golf"));
KualaLumpur_Att.push_back(Attraction(2, 01, "Bukit Tabur"));
KualaLumpur_Att.push_back(Attraction(3, 02, "Chan See Shu Yuen temple"));
KualaLumpur_Att.push_back(Attraction(4, 02, "Batu Caves"));
KualaLumpur_Att.push_back(Attraction(5, 02, "Cathedral of St.Mary"));
KualaLumpur_Att.push_back(Attraction(6, 02, "Masjid Negara Mosque"));
KualaLumpur_Att.push_back(Attraction(7, 03, "Berjaya Times Square"));
KualaLumpur_Att.push_back(Attraction(8, 03, "Pavilion Shopping Mall"));
for(int i = 0; i < KualaLumpur_Att.size(); i++){
cout << i+1 << "." << KualaLumpur_Att[i].get_attName() << endl;
}
int input;
cout<<"Choose the place you want in the form of the decimal \n";
cout<<"number that have listed above: \n";
cin>> input;
cout << "The place you have choose is: " << KualaLumpur_Att[input-1].get_attName();
return input;
}
else
{
vector<attraction> Malacca_Att;
Malacca_Att.push_back(Attraction(1, 01, "Tiara Melaka Golf & Country Club"));
Malacca_Att.push_back(Attraction(2, 01, "Wonderland Theme Park "));
Malacca_Att.push_back(Attraction(3, 02, "Cheng Hoon Teng Temple"));
Malacca_Att.push_back(Attraction(4, 02, "Sri Poyyatha Vinayagar Moorthi"));
Malacca_Att.push_back(Attraction(5, 02, "St. Francis Xavier's Church"));
Malacca_Att.push_back(Attraction(6, 02, "Masjid Tranquerah "));
Malacca_Att.push_back(Attraction(7, 03, "Mahkota Parade Mall"));
Malacca_Att.push_back(Attraction(8, 03, "Dataran Pahlawan Megamall"));
for(int i = 0; i < Malacca_Att.size(); i++)
{cout << i+1 << ". " << Malacca_Att[i].get_attName() << endl;}
int input;
cout<<"Choose the place you want in the form of the decimal \n";
cout<<"number that have listed above: \n";
cin>> input;
cout << "The place you have choose is: " << Malacca_Att[input-1].get_attName();
return input;
}
}
class Sports: public Attraction
{
int MinAge;
int MaxAge;
public:
Sports(int Att_id=0, int typeID=0, string Att_name="NULL", int MinAge=0, int MaxAge=0):Attraction(Att_id, typeID, Att_name), MinAge(MinAge), MaxAge(MaxAge){}
string getSprtname();
int getAgeMin()
{
return MinAge;
}
int getAgeMax()
{
return MaxAge;
}
virtual int display(int id);
};
string Sports::getSprtname()
{
return Att_name;
}
int Sports::display(int id){
cout<<"These are the list of Attractions \n";
if(id==1)
{
vector<sports>Georgetown_sports;
Georgetown_sports.push_back(Sports(1, 01, "Free Fall & Zip Lining",7,60));
Georgetown_sports.push_back(Sports(2, 01, "Tree Swings & Water Park",7,60));
for(int i=0; i<georgetown_sports.size();> {
cout<<i+1<<"."<<Georgetown_sports[i].getSprtname()<<endl;
}
cout<<"Choose the place that you want! Enter based on the \n";
cout<<"number that have listed according to the attraction: \n";
int input;
cin>>input;
cout<<"The place you have choose: "<<Georgetown_sports[input-1].getSprtname()<<endl
<<"The Minimum age can enter: "<<Georgetown_sports[input-1].getAgeMin()<<",The Maximum age can enter: "<<Georgetown_sports[input-1].getAgeMax()<<endl;
}
else if(id==2)
{
vector<sports>KualaLumpur_sports;
KualaLumpur_sports.push_back(Sports(1, 01, "Bukit Jalil Golf",18,60));
KualaLumpur_sports.push_back(Sports(2, 01, "Bukit Tabur",18,60));
for(int i=0; i<kualalumpur_sports.size();> {
cout<<i+1<<"."<<KualaLumpur_sports[i].getSprtname()<<endl;
}
cout<<"Choose the place that you want! Enter based on the \n";
cout<<"number that have listed according to the attraction: \n";
int input;
cin>>input;
cout<<"The place you have choose: "<<KualaLumpur_sports[input-1].getSprtname()<<endl
<<"The Minimum age can enter: "<<KualaLumpur_sports[input-1].getAgeMin()<<",The Maximum age can enter: "<<KualaLumpur_sports[input-1].getAgeMax()<<endl;
}
else
{
vector<sports>Malacca_sports;
Malacca_sports.push_back(Sports(1, 01, "Tiara Melaka Golf & Country Club",18,60));
Malacca_sports.push_back(Sports(2, 01, "Wonderland Theme Park ",7,60));
for(int i=0; i<malacca_sports.size();> {
cout<<i+1<<"."<<Malacca_sports[i].getSprtname()<<endl;
}
cout<<"Choose the place that you want! Enter based on the \n";
cout<<"number that have listed according to the attraction: \n";
int input;
cin>>input;
cout<<"The place you have choose: "<<Malacca_sports[input-1].getSprtname()<<endl
<<"The Minimum age can enter: "<<Malacca_sports[input-1].getAgeMin()<<",The Maximum age can enter: "<<Malacca_sports[input-1].getAgeMax()<<endl;
}
}
class Culture:public Attraction
{
double Entrance_Fee;
public:
Culture(int Att_id=0, int typeID=0, string Att_name="NULL", double Entrance_Fee=0):Attraction(Att_id, typeID, Att_name), Entrance_Fee(Entrance_Fee){}
string getCulname();
double getEntFee();
int display(int id);
};
double Culture::getEntFee(){
return Entrance_Fee;
}
string Culture::getCulname(){
return Att_name;
}
int Culture::display(int id){
cout<<"These are the list of Attractions \n";
if(id==1)
{
vector<culture>Georgetown_culture;
Georgetown_culture.push_back(Culture(3, 02, "Khoo Kongsi Temple",0));
Georgetown_culture.push_back(Culture(4, 02, "Sri Mariamman Temple",0));
Georgetown_culture.push_back(Culture(5, 02, "St. George's Church",0));
Georgetown_culture.push_back(Culture(6, 02, "Kapitan Keling Mosque",0));
for(int i=0; i<georgetown_culture.size();> {
cout<<i+1<<"."<<Georgetown_culture[i].getCulname()<<endl;
}
cout<<"Choose the place that you want! Enter based on the \n";
cout<<"number that have listed according to the attraction: \n";
int input;
cin>>input;
cout<<"The place you have choose: "<<Georgetown_culture[input-1].getCulname()<<endl
<<"The fees for the entrance: RM" <<Georgetown_culture[input-1].getEntFee()<<endl;
}
else if(id==2)
{
vector<culture>KualaLumpur_culture;
KualaLumpur_culture.push_back(Culture(3, 02, "Chan See Shu Yuen temple",0));
KualaLumpur_culture.push_back(Culture(4, 02, "Batu Caves",0));
KualaLumpur_culture.push_back(Culture(5, 02, "Cathedral of St.Mary",0));
KualaLumpur_culture.push_back(Culture(6, 02, "Masjid Negara Mosque",0));
for(int i=0; i<kualalumpur_culture.size();> {
cout<<i+1<<"."<<KualaLumpur_culture[i].getCulname()<<endl;
}
cout<<"Choose the place that you want! Enter based on the \n";
cout<<"number that have listed according to the attraction: \n";
int input;
cin>>input;
cout<<"The place you have choose: "<<KualaLumpur_culture[input-1].getCulname()<<endl
<<"The fees for the entrance: RM" <<KualaLumpur_culture[input-1].getEntFee()<<endl;
}
else
{
vector<culture>Malacca_culture;
Malacca_culture.push_back(Culture(3, 02, "Cheng Hoon Teng Temple",0));
Malacca_culture.push_back(Culture(4, 02, "Sri Poyyatha Vinayagar Moorthi",0));
Malacca_culture.push_back(Culture(5, 02, "St. Francis Xavier's Church",0));
Malacca_culture.push_back(Culture(6, 02, "Masjid Tranquerah ",0));
for(int i=0; i<malacca_culture.size();> {
cout<<i+1<<"."<<Malacca_culture[i].getCulname()<<endl;
}
cout<<"Choose the place that you want! Enter based on the \n";
cout<<"number that have listed according to the attraction: \n";
int input;
cin>>input;
cout<<"The place you have choose: "<<Malacca_culture[input-1].getCulname()<<endl
<<"The fees for the entrance: RM" << Malacca_culture[input-1].getEntFee()<<endl;
}
}
class Shopping:public Attraction{
string MallName;
public:
Shopping(int Att_id=0, int typeID=0, string MallName="NULL"):Attraction(Att_id, typeID), MallName(MallName){}
string getShoppingName();
int display(int id);
};
string Shopping::getShoppingName(){
return MallName;
}
int Shopping::display(int id){
cout<<"These are the list of Attractions \n";
if(id==1)
{
vector<shopping>Georgetown_shopping;
Georgetown_shopping.push_back(Shopping(6, 02, "Kapitan Keling Mosque"));
Georgetown_shopping.push_back(Shopping(7, 03, "Prangin Mall"));
Georgetown_shopping.push_back(Shopping(8, 03, "1st Avenue Mall"));
for(int i=0; i<georgetown_shopping.size();> {
cout<<i+1<<"."<<Georgetown_shopping[i].getShoppingName()<<endl;
}
cout<<"Choose the place that you want! Enter based on the \n";
cout<<"number that have listed according to the attraction: \n";
int input;
cin>>input;
cout<<"The place you have choose: "<<Georgetown_shopping[input-1].getShoppingName()<<endl;
}
else if(id==2)
{
vector<shopping>KualaLumpur_shopping;
KualaLumpur_shopping.push_back(Shopping(7, 03, "Berjaya Times Square"));
KualaLumpur_shopping.push_back(Shopping(8, 03, "Pavilion Shopping Mall"));
for(int i=0; i<kualalumpur_shopping.size();> {
cout<<i+1<<"."<<KualaLumpur_shopping[i].getShoppingName()<<endl;
}
cout<<"Choose the place that you want! Enter based on the \n";
cout<<"number that have listed according to the attraction: \n";
int input;
cin>>input;
cout<<"The place you have choose: "<<KualaLumpur_shopping[input-1].getShoppingName()<<endl;
}
else
{
vector<shopping>Malacca_shopping;
Malacca_shopping.push_back(Shopping(7, 03, "Mahkota Parade Mall"));
Malacca_shopping.push_back(Shopping(8, 03, "Dataran Pahlawan Megamall"));
for(int i=0; i<malacca_shopping.size();> {
cout<<i+1<<"."<<Malacca_shopping[i].getShoppingName()<<endl;
}
cout<<"Choose the place that you want! Enter based on the \n";
cout<<"number that have listed according to the attraction: \n";
int input;
cin>>input;
cout<<"The place you have choose: "<<Malacca_shopping[input-1].getShoppingName()<<endl;
}
}
int main(){
cout<<"--------------------------------/n";
cout<<"|| Welcome To Tourist System ||/n";
cout<<"--------------------------------/n";
cout<<"/n";
City y;
y.setID();
int id = y.getID();
cout << "\nThe ID of the City: " << id << endl << "The name of the City: " << y.getName() << endl;
int input = opt_user();
if(input==1)
{
Attraction choice;
choice.display(id);
}
else if(input==2)
{
Sports choice;
choice.display(id);
}
else if(input==3)
{
Culture choice;
choice.display(id);
}
else(input==4)
{
Shopping choice;
choice.display(id);
}
cout << "\n\nEnd of program.\n";
return 0;
}
[edit]Code block added - OriginalGriff[/edit]