subject

While writing a program to regulate the speed of a self-driving car, you find that your software sometimes miscalculates the ideal car speed for city streets to be over 1500 MPH (nearly twice the speed of sound), when it should be approximately 30 MPH. Which of the following strategies would be most efficient to employ in debugging your program?

a. At the very end of the speed calculations, add an additional line of code that divides the calculated speed by 50 so that the program never produces such high speeds
b. After each calculation within your program, insert a temporary statement that displays the most recently calculated value. When running your program, compare the displayed values with the expected values to identify where in the program the error is being introduced.
c. Starting at the end of your program and working backwards, systematically delete each line of code that relates to calculating and re-run the program after each deletion to identify where in the program the error is being introduced
d. Delete all of the code relating to speed calculations and rewrite it again

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:10
David is in week 3 of his current ashford course and has a paper due by monday night at midnight. he has finished everything but the concluding paragraph. as he boots up his computer to work on it, he sees a flash across the screen and then the screen goes black. he begins to panic as he tries desperately to turn the laptop back on. david should have saved his work on what kind of portable device?
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Jake really works well with numbers and is skilled with computers but doesn't work well with others. which of the jobs discussed in this unit might be best for jake? why?
Answers: 3
question
Computers and Technology, 23.06.2019 16:30
You have read about the beginnings of the internet and how it was created. what was the internet originally created to do? (select all that apply) share research. play games. communicate. share documents. sell toys
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Lakendra finished working on her monthly report. in looking it over, she saw that it had large blocks of white space. what steps could lakendra take to reduce the amount of white space?
Answers: 3
You know the right answer?
While writing a program to regulate the speed of a self-driving car, you find that your software som...
Questions
question
Mathematics, 10.11.2020 05:50
question
English, 10.11.2020 05:50
question
Mathematics, 10.11.2020 05:50
question
Biology, 10.11.2020 05:50