Start with this code and fill in the functions
##############################################################################################################################
#include
#include
#include
#include
using namespace std;
class River {
string name;
double kmLength;
public:
River() :
River("", -1) {
}
River(string name, double kmLength) {
this->name = name;
this->kmLength = kmLength;
}
double getKMLength() const {
eturn kmLength;
}
void setKMLength(double kmLength) {
this->kmLength = kmLength;
}
const string& getName() const {
eturn name;
}
void setName(const string &name) {
this->name = name;
}
};
void write(River a
Write[], int size) {
}
void read(River a
Read[], int size) {
}
int main() {
River a
Write[] = { River("Missouri", 2341), River("Mississippi", 2202), River("Yukon", 1979), River("Rio", 1759), River("Colorado", 2330) };
write(a
Write, 5);
River a
Read[5];
ead(a
Read, 5);
cout
left
setw(12)
"Name"
setw(3)
" "
setw(5)
"Length"
endl;
cout
setfill('=')
setw(22)
""
setfill(' ')
endl;
for (int i = 0; i < 5; ++i) {
cout
setw(12)
a
Read[i].getName();
cout
setw(3)
" ";
cout
setw(5)
a
Read[i].getKMLength();
cout
endl;
}
eturn 0;
}