But which step says to remove the member variables? Note that you were already asked about that in post #13.
Here's what I get when I follow the steps letter-by-letter (I didn't implement main since some of the steps were cut off). This code compiles without warnings (even with the
-Wall -Wextra -Wpedantic compiler flags):
Code:
// step 1
#include <string>
#include <iostream>
using namespace std;
// step 2
class Dog
{
// step 3
private:
int age, weight;
string color;
// step 4
public:
// step 5
void bark() { cout << "WOOF!" <<endl; }
// step 6
// void setAge(int yrs) { age = yrs; }
// void setWeight(int lbs) { weight = lbs; }
// void setColor(string hue) { color = hue; }
// multiple step 2 (replace the three setter methods (above) with a single combined setter prototype)
void setValues(int, int, string);
// step 7
int getAge() { return age; }
int getWeight() { return weight; }
string getColor() { return color; }
};
// multiple step 3
void Dog::setValues(int age, int weight, string color)
{
// multiple step 4
this->age = age;
this->weight = weight;
this->color = color;
}