Define a class RobotArm that includes a data component, handOpen, that is either true or false and another private data member, position, that is a position in three dimensions. Include three constructors, a default constructor, a constructor that takes 2 parameters (one for the hand state and one for the position) and a constructor that takes four parameters (the hand state and the x, y, z coordinates of the position ). Assume that your program includes the definition of class Position3D defined above.

What will be an ideal response?


```
class RobotArm { public:
RobotArm () {}
RobotArm( bool, const Position3D& );
RobotArm( bool, double, double, double );
private:
bool handOpen;
Position3D position;
};
RobotArm :: RobotArm( bool handState, const Position3D& aPosition )
{
handOpen = handState;
position = aPosition;
}
RobotArm :: RobotArm( bool handState, double x1, double y1, double z1 )
{
handOpen = handState;
position = Position3D( x1, y1, z1 );
}
```

Computer Science & Information Technology

You might also like to view...

Case-Based Critical Thinking QuestionsCase 2Brendan has inherited a form from the person who held his job previously. His manager would like him to make some substantial changes to it in order to make it more user-friendly for the records team. Brendan, however, is not an expert in form properties, so after he opens up the property sheet, he asks you for some advice. Brendan has one section of the form that should be visible to users in Form view but that they should not be able to print. How does he achieve this?

A. He sets the Display When form section property to Always. B. He sets the Display When form section property to Screen Only. C. He sets the Display When form section property to Hide. D. He sets the Display When form section property to Print Only.

Computer Science & Information Technology

A striped volume is __________ because the failure of a disk leads to a complete loss of information stored on the disk.

a. vulnerable b. fault tolerant c. There is no such thing as a striped volume. d. not fault tolerant

Computer Science & Information Technology

In SQL Server, password policies can be reconfigured and customized for each user login using the ____ function.

A. ALTER LOGIN B. SETUP C. USER D. PASSWORD

Computer Science & Information Technology

When you try to save a file, your computer gives you a warning that you do not have enough disk space. Which of the following upgrades target the warning?

a. adding more memory or RAM b. adding more disk space c. all of the above

Computer Science & Information Technology