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]
4 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]4 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
Which activity can be used to modify the value of an existing cell in a datatable
stepladder [879]

Answer:

The name of the activity is "Add Data Column".

Explanation:

Add data column activity is a part of the database that is used in used for adding a column in the database table. This activity also used in Windows.  

  • It provides attachment in windows activity by using Uipath studio.
  • The Uipath studio is used to connect with any application, that enables by windows, and to perform multiple operations on single user interface elements.
4 0
3 years ago
18) choose which article title would most likely be described by the database subject headings victims of famine, ireland, histo
Lunna [17]
I think the correct answer from the choices listed above is option B. The <span>article title that would most likely be described by the database subject headings victims of famine, ireland, history would be </span><span>''how many irish potato famine deaths? towards coherence of the evidence" Hope this answers the question.</span>
5 0
3 years ago
Superclass in python explanation
goblinko [34]

Answer:

The class from which a class inherits is called the parent or superclass. A class which inherits from a superclass is called a subclass, also called heir class or child class. Superclasses are sometimes called ancestors as well. There exists a hierarchical relationship between classes. It's similar to relationships or categorizations that we know from real life. Think about vehicles, for example. Bikes, cars, buses and trucks are vehicles. Pick-ups, vans, sports cars, convertibles and estate cars are all cars and by being cars they are vehicles as well. We could implement a vehicle class in Python, which might have methods like accelerate and brake. Cars, Buses and Trucks and Bikes can be implemented as subclasses which will inherit these methods from vehicle.

Explanation:

6 0
3 years ago
What is an operating system
AfilCa [17]
The operating system is the most basic program of a computer which needs other program in order to function and run.

Hope this helps !

Photon
5 0
3 years ago
Using the "split" string method from the preceding lesson, complete the get_word function to return the {n}th word from a passed
lana66690 [7]

Answer:

def get_word(sentence, n):

# Only proceed if n is positive

   if n > 0:

       words = sentence.split()

# Only proceed if n is not more than the number of words

       if n <= len(words):

           return words[n-1]

   return (" ")

print(get_word("This is a lesson about lists", 4)) # Should print: lesson

print(get_word("This is a lesson about lists", -4)) # Nothing

print(get_word("Now we are cooking!", 1)) # Should print: Now

print(get_word("Now we are cooking!", 5)) # Nothing

Explanation:

Added parts are highlighted.

If n is greater than 0, split the given sentence using split method and set it to the words.

If n is not more than the number of words, return the (n-1)th index of the words. Since the index starts at 0, (n-1)th index corresponds to the nth word

8 0
3 years ago
Other questions:
  • What does "WPA" stand for?
    15·2 answers
  • Return 1 if ptr points to an element within the specified intArray, 0 otherwise.
    7·1 answer
  • In the context of information systems, which of the following is a disadvantage of prototyping? a. A prototype is more difficult
    8·1 answer
  • A ____ is approximately a billion bytes.
    9·1 answer
  • True or False. Students taking courses log into Blackboard with their "key account" username and password.
    8·1 answer
  • Define function multiply(), and within the function: Get user input() of two strings made of whole numbers Cast the input to int
    11·1 answer
  • A small cluster of three countries (China, Malaysia, and Korea) are creating a reputation for this type of outsourcing. a. Farsh
    6·1 answer
  • Use the table and the drop-down menus to order the
    15·2 answers
  • How do you chose a profile pic on brainly?
    8·1 answer
  • Before u can open and edit a file, you need to zip it, T/F
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!