class State
This commit is contained in:
parent
fd630bd508
commit
a9ba899b81
24
pr6.cpp
24
pr6.cpp
@ -4,6 +4,30 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
class State {
|
||||
public:
|
||||
string name;
|
||||
string capital;
|
||||
string language;
|
||||
long population;
|
||||
double area;
|
||||
|
||||
State() : name(""), capital(""), language(""), population(0), area(0.0) {}
|
||||
State(string n, string c, string l, long p, double a)
|
||||
: name(n), capital(c), language(l), population(p), area(a) {}
|
||||
|
||||
friend ostream& operator<<(ostream& os, const State& state) {
|
||||
os << "State: " << state.name << ", Capital: " << state.capital
|
||||
<< ", Language: " << state.language << ", Population: " << state.population
|
||||
<< ", Area: " << state.area;
|
||||
return os;
|
||||
}
|
||||
|
||||
bool operator==(const State& other) const {
|
||||
return name == other.name;
|
||||
}
|
||||
};
|
||||
|
||||
template<class T>
|
||||
class Element {
|
||||
protected:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user