Question: Write a class Motor, which might be potentially used to encapsulate access to a physical motor. Create a header file declaring the class. Implement member

Write a class Motor, which might be potentially used to encapsulate access to a physical motor. Create a header file declaring
the class.
Implement member variables and functions that would cover motor's behaviour in the following scope: Each motor is
initially off and can be switched on and off. The speed can be increased from 0 to 10 in steps of one.
Advanced Option 1 The code will verify that the speed can only be increased in steps of 1 or 2 levels.
Advanced Option 2 The code will verify that the motor is on when the speed gets changed and the speed is zero when the
motor gets switched off.
In another file: Create an array with 5 motor objects. Switch on all motors. Write a function that will determine the average
motor speed and adjust all motors in the array as close to the average value as possible.
Advanced Option 3 Overload the operators > and to compare the motor speed between two motor objects.
Write a class Motor, which might be potentially

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!