Code in C++
CruiseControl is like the cruise control inyour car where you can set the cruise and then increment/decrementthe speed, and cancel. The CruiseControl will havea maximum possible speed. CruiseControl speed isalways positive. More specifically, CruiseControlspeed will always be in the range between 0 and some maxSpeedvalue. Program will be in a loop displaying a menu of possibleCruise Control commands (see example below).
Thus, your class CruiseControl must have twodata members/data attributes:
- target speed
- maximum speed
The primary member functions (operations) that you need toperform on the CruiseControl are:
- Default constructor: Set target speedvalue to 0, and MAX speed value to 150 integer value.
- Class constructor:
OROR