Question: using c++ 1. Please create a CuteRobot class. Member variable: int position; //in meters. x-axis position Member methods: 1). Constructor(s) //set default position 2). getPosition0

using c++ 1. Please create a CuteRobot class. Member variable: int position; //in meters. x-axis position Member methods: 1). Constructor(s) //set default position 2). getPosition0 //getter 3). CuteRobot& move(int steps)://Positive number for forward steps, negative number for backward motion. //Ideally, do function chaining here. Otherwise, you may implement: void move(int velocity); 4). void meet(CuteRobot * cr)://The function takes a pointer parameter, calculates the steps value when the cr obj meets this object, assuming this object stands still, and use move0 function to bring cr obj to this obj poistion. 2. In main() function Create an array of five CuteRobot objects. Initialize the position of five robots to 0,1,2,3,4, respectively. Can you use pointer arithmetic to loop through the array and use meet(0 method to bring every robots to to zero position (where the first robot stands)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
