Code C Cruisecontrol Like Cruise Control Car Set Cruise Increment Decrement Speed Cancel C Q37056089

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:
    OR
    OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.