Deck 10: Debugging

ملء الشاشة (f)
exit full mode
سؤال
A runtime error occurs because of a mistake made in the formulation of the logic used to accomplish a particular task.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Adding the retry statement to an exception handler can generate an endless loop, creating an entirely new problem.
سؤال
The best way to avoid logical errors is to carefully plan out the design of your programs before writing them.
سؤال
Syntax errors occur when a program attempts to perform an illegal action.
سؤال
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.
سؤال
Logical errors are program errors that occur if you do not correctly follow Ruby's syntactical rules when writing your program statements
سؤال
Unfortunately, syntax errors can also occur for a variety of reasons that are outside your control.
سؤال
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.
سؤال
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.
سؤال
When an error occurs in a Ruby program, an exception object is generated and information about the error is assigned to it.
سؤال
Generally, all you need in order to track down and fix a syntax error is the information provided by Ruby's error messages.
سؤال
Using the operator, you can access information about an exception.
سؤال
If your program recovers from an exception, you can use the retry statement to repeat the execution of an entire begin / end code block.
سؤال
Whenever an exception is raised, Ruby looks for an exception handler capable of handling it.
سؤال
When an exception is generated, it is said to be lowered.
سؤال
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.
سؤال
Ruby checks programs for syntax errors before executing them.
سؤال
The Kernel class's system method runs an external command or application as a separate process.
سؤال
Programming errors, sometimes referred to as bugs, are unique to Ruby programming.
سؤال
When an exception occurs, the interpreter displays an error message and forces the immediate termination of the program.
سؤال
____ 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
سؤال
Whenever an exception occurs, Ruby looks for an ____ capable of handling it.

A) error trap
B) exception trap
C) exception handler
D) error handler
سؤال
Ruby's debugger provides you with a test environment for running and monitoring your programs.
سؤال
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
سؤال
When an error occurs in a Ruby program, a ____ object is generated.

A) error
B) exception
C) runtime
D) syntax
سؤال
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
سؤال
What type of error will the following statement generate? puts 10 / 0

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

A) Syntax
B) Logical
C) Runtime
D) Overload
سؤال
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
سؤال
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
سؤال
The debugger is loaded by starting the Ruby interpreter with the -debug run option.
سؤال
____ 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
سؤال
Ruby allows you to programmatically deal with an error by ___ exceptions.

A) handling
B) ignoring
C) bypassing
D) None of the above
سؤال
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.
سؤال
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.
سؤال
A simple way of determining what is happening in a Ruby program is to strategically embedding print or puts statements throughout the program.
سؤال
When an exception is generated, it is said to be ____.

A) lowered
B) accelerated
C) trapped
D) raised
سؤال
Ruby checks programs for ____ errors before executing them.

A) Syntax
B) Logical
C) Runtime
D) Overload
سؤال
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
سؤال
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.
سؤال
To monitor and debug larger Ruby programs, you need to work with Ruby's built-in ____.

A) compiler
B) debugger
C) interpreter
D) analyzer
سؤال
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
سؤال
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
سؤال
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
سؤال
A ____ is a marker placed in a program that pauses program execution when it is reached.

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

A) >
B) =>
C) >=
D) !>
سؤال
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
سؤال
Adding the ____ statement to an exception handler can generate an endless loop

A) end
B) rescue
C) retry
D) begin
سؤال
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
سؤال
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 Deck
1/50
auto play flashcards
العب
simple tutorial
ملء الشاشة (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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
7
Unfortunately, syntax errors can also occur for a variety of reasons that are outside your control.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
12
Using the operator, you can access information about an exception.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
14
Whenever an exception is raised, Ruby looks for an exception handler capable of handling it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
15
When an exception is generated, it is said to be lowered.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
17
Ruby checks programs for syntax errors before executing them.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
18
The Kernel class's system method runs an external command or application as a separate process.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
19
Programming errors, sometimes referred to as bugs, are unique to Ruby programming.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
20
When an exception occurs, the interpreter displays an error message and forces the immediate termination of the program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
23
Ruby's debugger provides you with a test environment for running and monitoring your programs.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
25
When an error occurs in a Ruby program, a ____ object is generated.

A) error
B) exception
C) runtime
D) syntax
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
27
What type of error will the following statement generate? puts 10 / 0

A) Syntax
B) Logical
C) Runtime
D) Overload
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
28
____ errors occur when a program attempts to perform an illegal action.

A) Syntax
B) Logical
C) Runtime
D) Overload
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
31
The debugger is loaded by starting the Ruby interpreter with the -debug run option.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
37
When an exception is generated, it is said to be ____.

A) lowered
B) accelerated
C) trapped
D) raised
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
38
Ruby checks programs for ____ errors before executing them.

A) Syntax
B) Logical
C) Runtime
D) Overload
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
46
Using the ____ operator, you can access information about an exception.

A) >
B) =>
C) >=
D) !>
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
48
Adding the ____ statement to an exception handler can generate an endless loop

A) end
B) rescue
C) retry
D) begin
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.