Create the .cpp file of this .h file in c++ #include #include #include using namespace std; class Airport { public: Airport(){cout << "Creating blank airport. ";}; Airport(string newID){ IATA = newID; } Airport(Airport&); // copy constructor void Initialize(string newID, string newCity, long double newLat, long double newLong){ IATA = std::move(newID); city = std::move(newCity); latitude = newLat; longitude = newLong; } // ostream& operator << (ostream&); // ofstream& operator << (ofstream&); bool operator == (Airport); long double GetLat() {return latitude;} long double GetLong(){ return longitude;} string GetCity(){ return city;} string GetID() {return IATA;} void Print(); private: string IATA; string city; long double latitude, longitude; };
Create the .cpp file of this .h file in c++
#include <string>
#include <iostream>
#include <iomanip>
using namespace std;
class Airport {
public:
Airport(){cout << "Creating blank airport. ";};
Airport(string newID){ IATA = newID; }
Airport(Airport&); // copy constructor
void Initialize(string newID, string newCity, long double newLat, long double newLong){
IATA = std::move(newID);
city = std::move(newCity);
latitude = newLat;
longitude = newLong;
}
// ostream& operator << (ostream&);
// ofstream& operator << (ofstream&);
bool operator == (Airport);
long double GetLat() {return latitude;}
long double GetLong(){ return longitude;}
string GetCity(){ return city;}
string GetID() {return IATA;}
void Print();
private:
string IATA;
string city;
long double latitude, longitude;
};
Step by step
Solved in 2 steps