Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. The debugger is a tool that will debug your logic errors automatically A) Tru

ID: 673279 • Letter: 1

Question

1. The debugger is a tool that will debug your logic errors automatically

A) True
B) False

2. Which of the following is something you can do that will make debugging easier?

A) Breaking down into smaller parts
B) Using a lot of comments
C) Indenting your code, using a lot of comments, breaking down into smaller parts, and maintaining neatness and readability
D) Indenting your code

3. You have a situation where you want to stop the execution of code at a certain point to see how things function, what would you do?

A) Get the line number where there is an error and remove it from the code
B) Set a breakpoint
C) Try running the program again and pause it real fast
D) Set a continuation point

4. What does the continuation mode of the debugger do?

A) It continues execution to the end of the program
B) It continues execution to the next function/method call
C) It allows you to continue working on the program while its being debugged
D) It continues execution to the next breakpoint

5. If you have a program that gets to a certain point and appears to pause, then you probably have an infinite loop. Your next step may be to do which of the following:

A) Put a breakpoint after the loop
B) Put a breakpoint on the statement before the loop entry point
C) Put a breakpoint on the first statement in the loop
D) Put a watchpoint on the statement before the loop entry point

6. Which type of error is caused when code is executed but there are undesired results?

A) Syntax error
B) Runtime system error
C) An IDE error
D) Logic error

7. The debugger is a software tool that allows you to pause a program during execution and assists in the detection and correction of errors in computer programs.

A) True
B) False

8. What does the debugger's stack trace show you?

A) The amount of memory allocated
B) The variables that have been allocated by each function/method call
C) The current function/method that is being executed and all of the functions/methods that are awaiting its completion
D) The trace table of your program so you can see all of the values of the variables

9. If you would like to examine the execution of each instruction in a function/method call, then you should use which debugger action?

A) Step-Into
B) Step-Around
C) Continue
D) Step-Over

10. Where should you place breakpoints to debug an if..then statement?

A) At the very end of the statement
B) Before the condition of the if..then statement
C) Inside of the else condition
D) Debuggers are not used for if..then statements

Explanation / Answer

1.
false

2.
C) Indenting your code, using a lot of comments, breaking down into smaller parts, and maintaining neatness and readability

3.
B) Set a breakpoint

4.
D) It continues execution to the next breakpoint

5.
B) Put a breakpoint on the statement before the loop entry point

6.
D) Logic error

7.
A) True

8.
B) The variables that have been allocated by each function/method call

9.
A) Step-Into

10.
B) Before the condition of the if..then statement