Start with this code and fill in the functions ############################################################################################################################## #include #include #include...

1 answer below »
Here is the question below


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 { return kmLength; } void setKMLength(double kmLength) { this->kmLength = kmLength; } const string& getName() const { return name; } void setName(const string &name) { this->name = name; } }; void write(River arrWrite[], int size) { } void read(River arrRead[], int size) { } int main() { River arrWrite[] = { River("Missouri", 2341), River("Mississippi", 2202), River("Yukon", 1979), River("Rio", 1759), River("Colorado", 2330) }; write(arrWrite, 5); River arrRead[5]; read(arrRead, 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)="">< arrread[i].getname();="" cout="">< setw(3)="">< "="" ";="" cout="">< setw(5)="">< arrread[i].getkmlength();="" cout="">< endl; } return 0; } endl;="" }="" return="" 0;="">
Answered Same DayMay 14, 2021

Answer To: Start with this code and fill in the functions...

Aditya answered on May 14 2021
149 Votes
#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 {
return kmLength;
}
void setKMLength(double kmLength) {
this->kmLength = kmLength;
}
const string& getName() const {
return name;
}
void setName(const string &name) {
this->name =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here