I have to construct a "bug" in int main and use class to move the mug horizontally right then for each move the bug rotates 180 degrees.I have the program set up correctly I think but I just am not sure what you would use to get the bug to move horizontally and rotate. Any and all help is much appreciated.
#include <iostream>
usingnamespace std;
class Bug
{
private:
bool
Bug(int initial_position):Bug(0)
{
} //constructor
// Member functions
void turn();
{
} // The bug turns 180 degrees; it can only go in two directions
void move();
{
}
int get_position();
{
}
};
int main()
{
cout<<" 1 1"<<endl;
cout<<"*******"<<endl;
cout<<" *****"<<endl;
return 0;
}
When the program is ran it says it cannot open the output file. Would an error be occurring in the void display function? Is that why it is saying can not open the output file?
Okay awesome is there a way to display the bug after each move? Because the program you display runs thorough each move and displays the last one. Would that be possible?