Skip to content

Instantly share code, notes, and snippets.

@Khuzha
Last active October 18, 2020 22:26
Show Gist options
  • Save Khuzha/88f4c17e0d79bf86c50131cbf2bf5aff to your computer and use it in GitHub Desktop.
Save Khuzha/88f4c17e0d79bf86c50131cbf2bf5aff to your computer and use it in GitHub Desktop.
#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