Which of the following are actions a programmer could take when debugging a segment of code that would most likely lead to finding a problem and fixing it? (choose two)

A. Change the names of variables within the program and run the program again.
B. Display the value of variables at various points during the program.
C. Ask a friend or collaborator to look over the code segment to see if they are able to find any errors.
D. Delete the code and re-type it to make sure there were no spelling errors and that it was written correctly.

Respuesta :

Answer:

Option B and C are the correct answer for the above question

Explanation:

The above question asked about the work of the programmer to catch an error of the program--

  • Then the option B states that the programmer needs to prints the value of the various program variable on every line of the program which is the correct solution because it is used to find the error easily. It defines the value of every variable in every place of the program and the programmer caught the error statement in the program if anywhere the variable gets the false value.
  • The C option states to help from a friend, it is also a good solution because the friend can easily be caught the error of the program by seeing every line of code.
  • But the other option is not correct because the option A states that the change the name of the variable which is not a result of anything.
  • And the option D states that the code will be retyped again which is also not justify anything.

ACCESS MORE
EDU ACCESS