1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Aleks [24]
3 years ago
6

While writing a program to regulate the speed of a self-driving car, you find that your software sometimes miscalculates the ide

al 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
Computers and Technology
1 answer:
Likurg_2 [28]3 years ago
3 0

Answer:

b. <em>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.</em>

Explanation:

Logging statements are an effective debugging technique. It is a good way of finding the location of faulty logic in a program.

One can trace the root problem through logging intermediary outputs.

We can find out from where the program is producing unexpected or unintended calculations, when their's a weird output logged.

You might be interested in
What should be the extension to execute files?
Ganezh [65]
The correct answer is D. All of the above. Each of these extensions are able to execute files depending on what type of information the file contains.
5 0
3 years ago
What would a good digital citizen do in the following situation? Nick sees that his classmate left her email account open on a s
Inessa [10]
1234567898765432123456789876543212345678987654321
3 0
3 years ago
Make a class Employee with a name and salary. Make a class Manager inherit from Employee. Add an instance variable, named depart
sweet [91]

Answer:

see explaination

Explanation:

class Employee

{

String name;

double salary;

void tostring()

{

System.out.println("Employee:\nName: "+name+"\nSalary: "+salary+"\n");

}

Employee(String n,double s)

{

name=n;

salary=s;

}

}

class Manager extends Employee

{

String department;

void tostring()

{

System.out.println("Manager:\nName: "+name+"\nDepartment: "+department+"\nSalary: "+salary+"\n");

}

Manager(String n,double s,String d)

{

super(n,s);

department=d;

}

}

class Executive extends Manager

{

void tostring()

{

System.out.println("Executive:\nName: "+name+"\nDepartment: "+department+"\nSalary: "+salary+"\n");

}

Executive(String n,double s,String d)

{

super(n,s,d);

}

}

public class test

{

public static void main(String args[])

{

Employee e =new Employee("Neo",12000);

e.tostring();

Manager m =new Manager("Cramster",100000,"Homework");

m.tostring();

Executive ex =new Executive("Chuks",1000000,"Homework");

ex.tostring();

}

}

8 0
3 years ago
Which of the following electronic collaboration techniques is the best
muminat

Answer:

D. project management software

6 0
2 years ago
Read 2 more answers
You can us the (BLANK) symbol when you want to automatically add a set of numbers together in a spreadsheet
sleet_krkn [62]

Answer:

Σ

Explanation:

What symbol can you use when you want to automatically add a set of numbers together on excel?

✓ Σ This is the Greek letter Sigma. It is used to start the Autosum facility.

5 0
2 years ago
Other questions:
  • When pasting an object which has been copied from a different slide, where on the slide does the object paste, assuming nothing
    15·1 answer
  • What category of predefined formulas in Excel contains the Boolean functions?
    14·1 answer
  • The changing of values for an object through a system is represented by the _____. (Points : 6) communication diagram
    14·1 answer
  • A ___________ variable is used to add up a set of values. fill in the blank
    8·1 answer
  • 1 pound is equivalent to how many grams?<br>A.463.59 grams<br>B.10 grams<br>C.59 grams<br>D.5 grams​
    8·2 answers
  • 1. What is the Internet?
    8·2 answers
  • How did transistors revolutionize the world of computers?
    15·1 answer
  • What is cache memory?Mention its importance. ​
    12·1 answer
  • to protect a windows 10 system, you've configured system restore to automatically protect your system using restore points. will
    13·1 answer
  • Describe a new career in computer science that may be created in the future
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!