Deck 10: Debugging

Full screen (f)
exit full mode
Question
A runtime error occurs because of a mistake made in the formulation of the logic used to accomplish a particular task.
Use Space or
up arrow
down arrow
to flip the card.
Question
Adding the retry statement to an exception handler can generate an endless loop, creating an entirely new problem.
Question
The best way to avoid logical errors is to carefully plan out the design of your programs before writing them.
Question
Syntax errors occur when a program attempts to perform an illegal action.
Question
Runtime errors can sometimes be buried deep inside seldom-used methods and may not make their presence known until a particular set of circumstances occur.
Question
Logical errors are program errors that occur if you do not correctly follow Ruby's syntactical rules when writing your program statements
Question
Unfortunately, syntax errors can also occur for a variety of reasons that are outside your control.
Question
To define an error handler, you need to first identify a statement within your Ruby program where you think an error may be able to occur, then precede it with the start keyword.
Question
If you write a statement that is supposed to multiply two numbers but you accidentally divided one number by the other, a runtime error would occur.
Question
When an error occurs in a Ruby program, an exception object is generated and information about the error is assigned to it.
Question
Generally, all you need in order to track down and fix a syntax error is the information provided by Ruby's error messages.
Question
Using the operator, you can access information about an exception.
Question
If your program recovers from an exception, you can use the retry statement to repeat the execution of an entire begin / end code block.
Question
Whenever an exception is raised, Ruby looks for an exception handler capable of handling it.
Question
When an exception is generated, it is said to be lowered.
Question
If it finds a handler capable of handling an exception, control is transferred to the handler. Otherwise, an error message is displayed and the program terminates.
Question
Ruby checks programs for syntax errors before executing them.
Question
The Kernel class's system method runs an external command or application as a separate process.
Question
Programming errors, sometimes referred to as bugs, are unique to Ruby programming.
Question
When an exception occurs, the interpreter displays an error message and forces the immediate termination of the program.
Question
____ errors are ones that occur if you do not correctly follow Ruby's syntactical rules when writing your program statements.

A) Syntax
B) Logical
C) Runtime
D) Overload
Question
Whenever an exception occurs, Ruby looks for an ____ capable of handling it.

A) error trap
B) exception trap
C) exception handler
D) error handler
Question
Ruby's debugger provides you with a test environment for running and monitoring your programs.
Question
Using the Kernel class's ____ method, you can execute an external command or application as a separate process.

A) syscall
B) system
C) superclass
D) status
Question
When an error occurs in a Ruby program, a ____ object is generated.

A) error
B) exception
C) runtime
D) syntax
Question
When a(n) ____ occurs, the interpreter default behavior is to display an error message and force the immediate termination of the program.

A) syntax
B) error
C) exception
D) runtime
Question
What type of error will the following statement generate? puts 10 / 0

A) Syntax
B) Logical
C) Runtime
D) Overload
Question
____ errors occur when a program attempts to perform an illegal action.

A) Syntax
B) Logical
C) Runtime
D) Overload
Question
Which of the following is a type of error that Ruby programs are subject to?

A) Logical
B) Runtime
C) Syntax
D) All of the above
Question
To define an error handler, you need to first identify a statement within your Ruby program where you think an error may be able to occur, then precede it with the ____ keyword.

A) rescue
B) retry
C) begin
D) end
Question
The debugger is loaded by starting the Ruby interpreter with the -debug run option.
Question
____ errors can sometimes be buried deep inside seldom-used methods and may not make their presence known until a particular set of circumstances occur.

A) Syntax
B) External
C) Runtime
D) Overload
Question
Ruby allows you to programmatically deal with an error by ___ exceptions.

A) handling
B) ignoring
C) bypassing
D) None of the above
Question
Ruby's built-in debugger allows you to monitor and control the execution of your programs on a statement-by-statement basis, pausing to check on the value of variables when necessary.
Question
If an exception occurs and a exception handler cannot be found to handle it, what happens?

A) An error message is displayed and the program terminates
B) An error message is displayed and the program continues its execution
C) An error message is displayed, prompted the user to continue or terminate the program
D) Program executes stops and no error is generated.
Question
A simple way of determining what is happening in a Ruby program is to strategically embedding print or puts statements throughout the program.
Question
When an exception is generated, it is said to be ____.

A) lowered
B) accelerated
C) trapped
D) raised
Question
Ruby checks programs for ____ errors before executing them.

A) Syntax
B) Logical
C) Runtime
D) Overload
Question
A(n) ____ error occurs because of a mistake made in the formulation of the logic used to accomplish a particular task.

A) Syntax
B) Logical
C) Runtime
D) Overload
Question
You can type the word break to generate a list of all currently set breakpoints and to see the line number associated with each breakpoint.
Question
To monitor and debug larger Ruby programs, you need to work with Ruby's built-in ____.

A) compiler
B) debugger
C) interpreter
D) analyzer
Question
If your program recovers from an exception, you can use the ____ statement to repeat the execution of an entire begin / end code block

A) retry
B) rescue
C) end
D) begin
Question
When debugging a Ruby program, you can use the ____ method to examine the value assigned to the program's local variables.

A) var local
B) var variable
C) show local
D) show variable
Question
When debugging a Ruby program, you can use the ____ method to execute the next statement in the program and then halt program execution.

A) skip
B) run
C) step
D) continue
Question
A ____ is a marker placed in a program that pauses program execution when it is reached.

A) marker
B) pointer
C) link
D) breakpoint
Question
Using the ____ operator, you can access information about an exception.

A) >
B) =>
C) >=
D) !>
Question
When debugging a Ruby program, you can use the ____ method to execute the program without any stepping, stopping execution when a breakpoint is reached or the programs ends.

A) run
B) cont
C) execute
D) continue
Question
Adding the ____ statement to an exception handler can generate an endless loop

A) end
B) rescue
C) retry
D) begin
Question
To start the Ruby debugger, you execute which of the following commands?

A) ruby -i debug
B) ruby -e debug
C) ruby -x debug
D) ruby -r debug
Question
Exceptions that occur within Ruby programs are treated as objects from the ____ class and its family of subclasses.

A) Kernel
B) Error
C) Numeric
D) Exception
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 10: Debugging
1
A runtime error occurs because of a mistake made in the formulation of the logic used to accomplish a particular task.
False
2
Adding the retry statement to an exception handler can generate an endless loop, creating an entirely new problem.
True
3
The best way to avoid logical errors is to carefully plan out the design of your programs before writing them.
True
4
Syntax errors occur when a program attempts to perform an illegal action.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
Runtime errors can sometimes be buried deep inside seldom-used methods and may not make their presence known until a particular set of circumstances occur.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
Logical errors are program errors that occur if you do not correctly follow Ruby's syntactical rules when writing your program statements
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
Unfortunately, syntax errors can also occur for a variety of reasons that are outside your control.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
To define an error handler, you need to first identify a statement within your Ruby program where you think an error may be able to occur, then precede it with the start keyword.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
If you write a statement that is supposed to multiply two numbers but you accidentally divided one number by the other, a runtime error would occur.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
When an error occurs in a Ruby program, an exception object is generated and information about the error is assigned to it.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
Generally, all you need in order to track down and fix a syntax error is the information provided by Ruby's error messages.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
Using the operator, you can access information about an exception.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
If your program recovers from an exception, you can use the retry statement to repeat the execution of an entire begin / end code block.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
Whenever an exception is raised, Ruby looks for an exception handler capable of handling it.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
When an exception is generated, it is said to be lowered.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
If it finds a handler capable of handling an exception, control is transferred to the handler. Otherwise, an error message is displayed and the program terminates.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
Ruby checks programs for syntax errors before executing them.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
The Kernel class's system method runs an external command or application as a separate process.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
Programming errors, sometimes referred to as bugs, are unique to Ruby programming.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
When an exception occurs, the interpreter displays an error message and forces the immediate termination of the program.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
____ errors are ones that occur if you do not correctly follow Ruby's syntactical rules when writing your program statements.

A) Syntax
B) Logical
C) Runtime
D) Overload
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
Whenever an exception occurs, Ruby looks for an ____ capable of handling it.

A) error trap
B) exception trap
C) exception handler
D) error handler
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
Ruby's debugger provides you with a test environment for running and monitoring your programs.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
Using the Kernel class's ____ method, you can execute an external command or application as a separate process.

A) syscall
B) system
C) superclass
D) status
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
When an error occurs in a Ruby program, a ____ object is generated.

A) error
B) exception
C) runtime
D) syntax
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
When a(n) ____ occurs, the interpreter default behavior is to display an error message and force the immediate termination of the program.

A) syntax
B) error
C) exception
D) runtime
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
What type of error will the following statement generate? puts 10 / 0

A) Syntax
B) Logical
C) Runtime
D) Overload
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
____ errors occur when a program attempts to perform an illegal action.

A) Syntax
B) Logical
C) Runtime
D) Overload
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
Which of the following is a type of error that Ruby programs are subject to?

A) Logical
B) Runtime
C) Syntax
D) All of the above
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
To define an error handler, you need to first identify a statement within your Ruby program where you think an error may be able to occur, then precede it with the ____ keyword.

A) rescue
B) retry
C) begin
D) end
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
The debugger is loaded by starting the Ruby interpreter with the -debug run option.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
____ errors can sometimes be buried deep inside seldom-used methods and may not make their presence known until a particular set of circumstances occur.

A) Syntax
B) External
C) Runtime
D) Overload
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
Ruby allows you to programmatically deal with an error by ___ exceptions.

A) handling
B) ignoring
C) bypassing
D) None of the above
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
Ruby's built-in debugger allows you to monitor and control the execution of your programs on a statement-by-statement basis, pausing to check on the value of variables when necessary.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
If an exception occurs and a exception handler cannot be found to handle it, what happens?

A) An error message is displayed and the program terminates
B) An error message is displayed and the program continues its execution
C) An error message is displayed, prompted the user to continue or terminate the program
D) Program executes stops and no error is generated.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
A simple way of determining what is happening in a Ruby program is to strategically embedding print or puts statements throughout the program.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
When an exception is generated, it is said to be ____.

A) lowered
B) accelerated
C) trapped
D) raised
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
Ruby checks programs for ____ errors before executing them.

A) Syntax
B) Logical
C) Runtime
D) Overload
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
A(n) ____ error occurs because of a mistake made in the formulation of the logic used to accomplish a particular task.

A) Syntax
B) Logical
C) Runtime
D) Overload
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
You can type the word break to generate a list of all currently set breakpoints and to see the line number associated with each breakpoint.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
To monitor and debug larger Ruby programs, you need to work with Ruby's built-in ____.

A) compiler
B) debugger
C) interpreter
D) analyzer
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
If your program recovers from an exception, you can use the ____ statement to repeat the execution of an entire begin / end code block

A) retry
B) rescue
C) end
D) begin
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
When debugging a Ruby program, you can use the ____ method to examine the value assigned to the program's local variables.

A) var local
B) var variable
C) show local
D) show variable
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
When debugging a Ruby program, you can use the ____ method to execute the next statement in the program and then halt program execution.

A) skip
B) run
C) step
D) continue
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
A ____ is a marker placed in a program that pauses program execution when it is reached.

A) marker
B) pointer
C) link
D) breakpoint
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
Using the ____ operator, you can access information about an exception.

A) >
B) =>
C) >=
D) !>
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
When debugging a Ruby program, you can use the ____ method to execute the program without any stepping, stopping execution when a breakpoint is reached or the programs ends.

A) run
B) cont
C) execute
D) continue
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
Adding the ____ statement to an exception handler can generate an endless loop

A) end
B) rescue
C) retry
D) begin
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
To start the Ruby debugger, you execute which of the following commands?

A) ruby -i debug
B) ruby -e debug
C) ruby -x debug
D) ruby -r debug
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
Exceptions that occur within Ruby programs are treated as objects from the ____ class and its family of subclasses.

A) Kernel
B) Error
C) Numeric
D) Exception
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.