Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can anyone find the error in th following code? I keep getting these errors and

ID: 3658401 • Letter: C

Question

Can anyone find the error in th following code? I keep getting these errors and I'm confused as to why.

#include <iostream>
using namespace std;

class Sky
{
public:
Sky()
{ cout << "Entering the sky. "; }
Sky(string color)
{ cout << "The sky is " << color << endl; }
~Sky()
{ cout << "Leaving the sky. "; }
};

class Ground : public Sky
{
public:
Ground()
{ cout << "Entering the Ground. "; }
Ground(string c1, string c2) : Sky(c1)
{ cout << "The ground is " << c2 << endl; }
~Ground()
{ cout << "Leaving the Ground. "; }
};

int main()
{
Ground object;
return 0;
}


Explanation / Answer

you forgot to include your string library. #include//add this before using strings