Question: For this example, you are going to build a simple cruise control system. Assume the speed is set to 6 5 mph ( call this

For this example, you are going to build a simple cruise control system. Assume the speed is
set to 65 mph (call this variable sset). Start by having the code ask the user for the current
speed and save it to the variable s. The system will respond in one of the ways below:
1. If the speed is 2 mph lower than the set speed, the car speeds up by 1 mph.
2. If the speed is 2 mph higher than the set speed, the car slows down by 1 mph, but
3. If the speed is 5 mph higher than the set speed, the car slows down by 2 mph.
Build a script file that integrates the logic above using an if .... Be very careful with your else
statement though. Notice there is one logical expression missing from the list that you need to at
least consider.
8

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 Programming Questions!