I have 3 files for a small project that I'm working on. The files are main.cpp, Airline.h (This is where my classes are stored) and Airline.cpp (This is where my functions are stored).
As of now, when I test the code out, I get an error that says:
undefined reference to "programInformation::mainMenu()
Can anyone see if there's any issues in my files, and how I have my folders set up?
#include <iostream>
#include "AirlineClass.h"
using namespace std;
void programInformation::mainMenu(){
cout << " Welcome to DFW Airport " << endl;
cout << "=================================" << endl;
cout << "------------Main Menu------------" << endl;
cout << "1. Customer Details" << endl;
cout << "2. Flight Registration " << endl;
cout << "3. Ticket and Charges " << endl;
cout << "4. Exit" << endl;
cout << "Select Option" << endl;
int option;
cin >> option;
switch(option){
case 1:
{
customerInformation info;
info.obtainInformation();
info.displayInformation();
break;
}
case 2:
{
}
case 3:
{
}
case 4:
{
}
}
}
#ifndef AIRLINECLASS_AIRLINECLASS_H
#define AIRLINECLASS_AIRLINECLASS_H
#include <iostream>
#include <string>
using namespace std;
class programInformation
{
public:
void mainMenu();
};
class customerInformation
{
private:
string firstName;
string lastName;
string countryResidence;
string gender;
string birthday;
int phoneNumber;
int age;
public:
void obtainInformation()
{
cout << "Enter First Name" << endl;
getline(cin, firstName);
cout << "Enter Last Name" << endl;
getline(cin, lastName);
cout << "Enter Age" << endl;
cin >> age;
cout << "Enter Gender" << endl;
getline(cin, gender);
cout << "Enter Birthday in the following formation: MM/DD/YYYY" << endl;
getline(cin, birthday);
cout << "Enter Phone Number" << endl;
cin >> phoneNumber;
cout << "Enter Country of Residency" << endl;
getline(cin, countryResidence);
}
void displayInformation()
{
cout << " Passanger Information " << endl;
cout << "===============================" << endl;
cout << "First Name - " << firstName << endl;
cout << "Last Name - " << lastName << endl;
cout << "Age - " << age << endl;
cout << "Gender - " << gender << endl;
cout << "Birthday mm/dd/yyyy - " << birthday << endl;
cout << "Phone Number - " << phoneNumber << endl;
cout << "Country of Residence - " << countryResidence << endl;
}
};
#endif
#include <iostream>
#include "AirlineClass.h"
using namespace std;
int main()
{
programInformation startProgram;
startProgram.mainMenu();
return 0;
}