Looking for answers? Westonci.ca is your go-to Q&A platform, offering quick, trustworthy responses from a community of experts. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform.

reimplement the bug class from this self check exercise, but use a different internal representation. represent the distance climbed by a string of - characters, one for every 10 cm. the up, reset, and get position member functions should have the exact same behavior as before, so the bug slides back to the bottom when it reaches the top of the pole (at 100 cm). of course, their implementation will be quite different.
#include
#include
using namespace std;
class Bug
{
public:
// Provide the public interface for get_position, reset, and up
private:
string climbed;
};
// Implement the get_position, reset, and up member functions
int main()
{
Bug bugsy;
Bug itsy_bitsy;
bugsy.reset();
itsy_bitsy.reset();
bugsy.up();
bugsy.up();
cout << bugsy.get_position() << endl;
cout << "Expected: 20" << endl;
itsy_bitsy.up();
itsy_bitsy.up();
itsy_bitsy.up();
cout << itsy_bitsy.get_position() << endl;
cout << "Expected: 30" << endl;
for (int i = 1; i <= 8; i++) { bugsy.up(); }
cout << bugsy.get_position() << endl;
cout << "Expected: 0" << endl;
bugsy.up();
cout << bugsy.get_position() << endl;
cout << "Expected: 10" << endl;
return 0;
}