Create a class Robot with the following public attributes an

Create a class \"Robot\" with the following public attributes: an integer x for the robot\'s x position an integer y for the robot\'s y position a character heading for the robot\'s heading (N\', \'S\', \'E\', \"W\') Then, add a public constructor that takes an int start x, int start y, and char start_heading and sets the robot\'s attributes. Answer: (penalty regime: 0 %) Check

Solution

Answer:

class Robot {
public:
int x,y;
char heading;
Robot(int start_x,int start_y, char start_heading) {
x = start_x;
y = start_y;
heading = start_heading;
}
};


Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site