Deck 3: Program Correctness and Efficiency
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/25
العب
ملء الشاشة (f)
Deck 3: Program Correctness and Efficiency
1
__________ errors occur during program execution.
Run-time
2
Consider the set of statements below:
Since you would normally declare average as a(n) __________ value, you cast an int value in sum to type double before doing the division.
A) bool
B) long
C) int
D) double

A) bool
B) long
C) int
D) double
double
3
Incorrect loop control parameters can cause array-index-out-of-bounds errors.
True
4
If you attempt to de-reference a(n) __________ pointer, the operating system will generally issue an error message and terminate the program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
5
A(n) __________ error occurs when the programmer/analyst has made a mistake in the design of a class or a class function or has implemented an algorithm incorrectly.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
6
You can insert code in your program that throws an exception when a particular kind of error occurs.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
7
If the value of -5 is passed to the function below, control will pass to the __________.

A) try statement
B) catch statement
C) error handler
D) exception handler

A) try statement
B) catch statement
C) error handler
D) exception handler
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
8
To avoid uncaught exceptions you write a(n) __________block that can throw an exception and follow it with a catch block that actually catches an exception and handles it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
9
The standard exception classes derived from class exception all have a member function named __________.
A) what
B) which
C) how
D) why
A) what
B) which
C) how
D) why
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
10
C++ allows you to define an exception handler that will catch all exceptions by using __________ as the exception handler parameter.
A) ***
B) ...
C) ###
D) &&&
A) ***
B) ...
C) ###
D) &&&
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
11
Industrial experience has shown that the use of structured walkthroughs is ineffective in detecting errors and removing defects.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
12
__________ testing is system testing designed to show that a program meets its functional requirements.
A) Unit
B) Integration
C) System
D) Acceptance
A) Unit
B) Integration
C) System
D) Acceptance
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
13
Given the need to test five if statements that are not nested, full path coverage could require up to __________ test cases.
A) 5
B) 10
C) 25
D) 32
A) 5
B) 10
C) 25
D) 32
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
14
In __________ testing, we are concerned with the relationship between the unit inputs and outputs.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
15
The compile time function sizeof() returns the size of its argument in __________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
16
In the context of testing, a(n) __________ program declares any necessary object instances and variables, assigns values to any of the function's inputs (as specified in the function's preconditions), calls the function, and displays the values of any outputs returned by the function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
17
A program that executes a series of tests and reports the results is known as a test __________.
A) suite
B) harness
C) framework
D) driver
A) suite
B) harness
C) framework
D) driver
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
18
In the context of integration testing, the word __________ is used to represent a function, a class, or a collection of classes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
19
Debugging is the major activity performed by programmers during the testing phase.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
20
Using a debugger to execute in increments as small as one program statement is called __________ execution.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which of the following assertions correctly captures the error of passing a negative number to the fib function defined below?

A) assert (n >= 0);
B) assert (n > 0);
C) assert (n <= 0);
D) assert (n < 0);

A) assert (n >= 0);
B) assert (n > 0);
C) assert (n <= 0);
D) assert (n < 0);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
22
If we can see how an algorithm's execution time increases with respect to n, we can compare two algorithms by examining their __________.
A) input
B) length
C) internal structure
D) growth rates
A) input
B) length
C) internal structure
D) growth rates
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
23
The for loop below is O ( __________ ).

A) n
B) n*3
C) log n
D) n 3

A) n
B) n*3
C) log n
D) n 3
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
24
An O(n2 ) algorithm is never more efficient than an O(n log n) algorithm.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
25
If we have an O(2n) algorithm that takes an hour for 100 inputs, adding 10 more inputs will add __________ hours to processing time.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck