-
-
Save Khuzha/88f4c17e0d79bf86c50131cbf2bf5aff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
class Exchange { | |
public: | |
string getApiUrl() { | |
return apiUrl; | |
} | |
void setApiUrl(string value) { | |
apiUrl = value; | |
} | |
string getName() { | |
return name; | |
} | |
void setName(string value) { | |
name = value; | |
} | |
string getType() { | |
return type; | |
} | |
void setType(string value) { | |
type = value; | |
} | |
string getUrl() { | |
return url; | |
} | |
void setUrl(string value) { | |
url = value; | |
} | |
protected: | |
string apiUrl; | |
string name; | |
string type; | |
string url; | |
}; | |
class StockExchange: public Exchange { | |
public: | |
StockExchange(string title, string cur, string loc) { | |
name = title; | |
currency = cur; | |
city = loc; | |
type = 'stock'; | |
} | |
private: | |
string currency; | |
string city; | |
}; | |
class CryptoExchange: Exchange { | |
}; | |
int main() { | |
StockExchange moex("MOEX", "RUB", "Moscow"); | |
moex.setUrl("moex.com"); | |
string url = moex.getUrl(); | |
cout << url; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment