Deck 5: Algorithms

ملء الشاشة (f)
exit full mode
سؤال
Which of the following is not a type of statement found in a typical high-level imperative programming language?

A) Imperative statement
B) Exclamatory statement
C) Declarative statement
D) Comment statement
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Which of the following is not associated with object-oriented programming?

A) Inheritance
B) Resolution
C) Encapsulation
D) Polymorphism
سؤال
Which of the following is not a control statement?

A) If-then-else statement
B) While loop statement
C) Assignment statement
D) For loop statement
سؤال
Which of the following is not a possible value of the expression 4 + 6 /2 - 1

A) 4
B) 5
C) 6
D) 10
سؤال
Which of the following is not constructed by a typical compiler?

A) Source code
B) Symbol table
C) Parse tree
D) Object program
سؤال
Which of the following is not a control statement?

A) If-then-else statement
B) While loop statement
C) Assignment statement
D) For loop statement
سؤال
Which of the following is not associated with the concept of data type?

A) Coercion
B) Boolean
C) Operator precedence
D) Strongly typed language
سؤال
Which of the following is ignored by a compiler?

A) Control statements
B) Declarations of constants
C) Procedure headers
D) Comment statements
سؤال
Which of the following is an example of a language that is based on the functional paradigm?

A) LISP
B) PROLOG
C) C
D) C++
سؤال
Most machine languages are based on the

A) Imperative paradigm
B) Declarative paradigm
C) Functional paradigm
D) Object-oriented paradigm
سؤال
Which of the following statements is not a resolvent of the following clauses? Which of the following statements is not a resolvent of the following clauses?  <div style=padding-top: 35px>
سؤال
Positions within arrays are identified by means of numbers called

A) Indices
B) Parameters
C) Instance variables
D) Constants
سؤال
Which of the following is a means of nullifying conflicts among data types?

A) Inheritance
B) Parsing
C) Coercion
D) Code optimization
سؤال
Which of the following is a means of defining similar yet different classes in an object-oriented program?

A) Inheritance
B) Parsing
C) Coercion
D) Code optimization
سؤال
Which of the following is the scope of a variable?

A) The number of characters in the variable's name
B) The portion of the program in which the variable can be accessed
C) The type associated with the variable
D) The structure associated with the variable
سؤال
Which of the following is not a parse tree of an expression based on the following grammar? <strong>Which of the following is not a parse tree of an expression based on the following grammar?  </strong> A) B) C)       <div style=padding-top: 35px>

A)
B)
C)
<strong>Which of the following is not a parse tree of an expression based on the following grammar?  </strong> A) B) C)       <div style=padding-top: 35px>
<strong>Which of the following is not a parse tree of an expression based on the following grammar?  </strong> A) B) C)       <div style=padding-top: 35px>
<strong>Which of the following is not a parse tree of an expression based on the following grammar?  </strong> A) B) C)       <div style=padding-top: 35px>
سؤال
Which of the following does not require a Boolean structure?

A) If-then-else statement
B) While loop statement
C) Assignment statement
D) For loop statement
سؤال
Which of the following is an example of a language that is based on the object-oriented paradigm?

A) LISP
B) PROLOG
C) C
D) C++
سؤال
Which of the following is not a step in the process of translating a program?

A) Executing the program
B) Parsing the program
C) Lexical analysis
D) Code generation
سؤال
Which of the following is not a way of referring to a value in a program?

A) Variable
B) Literal
C) Constant
D) Type
سؤال
Explain the distinction between the imperative and declarative programming paradigms.
سؤال
In the context of the object-oriented paradigm, ____________ are templates from which
____________ are constructed. We say that the latter is an instance of the former.
سؤال
Explain why the generation approach to classifying programming languages fails to capture the full scope of today's languages.
سؤال
What general rule should be added to the Prolog program below so that Prolog can conclude that ice cream is better than spinach?
better(icecream, peanutbutter).
better(peanutbutter, spinach).
___________________________________________________________
سؤال
What does it mean to say that a programming language is machine independent?
سؤال
List four data types that occur as primitive types in many high-level programming languages.
____________________ ____________________
____________________ ____________________
سؤال
Based on the Prolog program below, what goal should be used to find the siblings of sue? Based on the Prolog program below, what goal should be used to find the siblings of sue?   _________________________________________<div style=padding-top: 35px> _________________________________________
سؤال
To say that a grammar is ambiguous means that ___________________________________________
_____________________________________________________________________ .
سؤال
List two disadvantages of both machine languages and assembly languages that are overcome by high-level programming languages.
_____________________________________
_____________________________________
سؤال
Rewrite the following instructions using a single if-then-else statement. Rewrite the following instructions using a single if-then-else statement.  <div style=padding-top: 35px>
سؤال
Which of the following can Prolog conclude from the following program? parent(jill, sue).
Parent(jill, sally).
Parent(john, sue).
Parent(john, sally).
Sibling(X, Y) :- parent(Z, X), parent(Z, Y).

A) parent(jill, john)
B) sister(sue, sally)
C) sibling(sue, sally)
D) sibling(jill, sue)
سؤال
A data structure in which all elements have the same type is called ___________________, whereas a ________________ may have elements of different types.
سؤال
What clause would produce the resolvent
P OR R OR S
when resolved with the clause
P OR \rightharpoondown Q
__________________
سؤال
In addition to the procedure's name, what other information is contained in a typical procedure header?
____________________________________
سؤال
Based on the sketch of a class definition below, which methods can be invoked from outside an instance of the class? Based on the sketch of a class definition below, which methods can be invoked from outside an instance of the class?   _________________________________________________________<div style=padding-top: 35px> _________________________________________________________
سؤال
Why is the straightforward "goto" statement no longer popular in high-level programming languages?
سؤال
In contrast to _______________ languages such as English and Spanish, programming languages are
considered _______________ languages and are rigorously defined by their grammars.
سؤال
In the context of the object-oriented paradigm, a __________________ is an imperative program unit that describes how an object should react to a particular stimulus.
سؤال
Explain the distinction between translating a program (in a high-level language) and interpreting the program.
سؤال
Explain the distinction between a formal parameter and an actual parameter.
سؤال
Explain the distinction between a procedure and a function.
سؤال
Based on the grammar below, draw a parse tree showing that the string "drip drip drip" is a Leak. Based on the grammar below, draw a parse tree showing that the string drip drip drip is a Leak.  <div style=padding-top: 35px>
سؤال
Explain why key words in a programming language are often reserved words.
سؤال
Show that the grammar below is ambiguous by drawing two distinct parse trees for the string "drip drip drip." Show that the grammar below is ambiguous by drawing two distinct parse trees for the string drip drip drip.  <div style=padding-top: 35px>
سؤال
Explain the distinction between global and local variables.
سؤال
In the context of the object-oriented paradigm, what is a constructor?
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/46
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 5: Algorithms
1
Which of the following is not a type of statement found in a typical high-level imperative programming language?

A) Imperative statement
B) Exclamatory statement
C) Declarative statement
D) Comment statement
B
2
Which of the following is not associated with object-oriented programming?

A) Inheritance
B) Resolution
C) Encapsulation
D) Polymorphism
B
3
Which of the following is not a control statement?

A) If-then-else statement
B) While loop statement
C) Assignment statement
D) For loop statement
C
4
Which of the following is not a possible value of the expression 4 + 6 /2 - 1

A) 4
B) 5
C) 6
D) 10
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
5
Which of the following is not constructed by a typical compiler?

A) Source code
B) Symbol table
C) Parse tree
D) Object program
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
6
Which of the following is not a control statement?

A) If-then-else statement
B) While loop statement
C) Assignment statement
D) For loop statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which of the following is not associated with the concept of data type?

A) Coercion
B) Boolean
C) Operator precedence
D) Strongly typed language
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
8
Which of the following is ignored by a compiler?

A) Control statements
B) Declarations of constants
C) Procedure headers
D) Comment statements
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
9
Which of the following is an example of a language that is based on the functional paradigm?

A) LISP
B) PROLOG
C) C
D) C++
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
10
Most machine languages are based on the

A) Imperative paradigm
B) Declarative paradigm
C) Functional paradigm
D) Object-oriented paradigm
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which of the following statements is not a resolvent of the following clauses? Which of the following statements is not a resolvent of the following clauses?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
12
Positions within arrays are identified by means of numbers called

A) Indices
B) Parameters
C) Instance variables
D) Constants
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
13
Which of the following is a means of nullifying conflicts among data types?

A) Inheritance
B) Parsing
C) Coercion
D) Code optimization
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
14
Which of the following is a means of defining similar yet different classes in an object-oriented program?

A) Inheritance
B) Parsing
C) Coercion
D) Code optimization
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
15
Which of the following is the scope of a variable?

A) The number of characters in the variable's name
B) The portion of the program in which the variable can be accessed
C) The type associated with the variable
D) The structure associated with the variable
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
16
Which of the following is not a parse tree of an expression based on the following grammar? <strong>Which of the following is not a parse tree of an expression based on the following grammar?  </strong> A) B) C)

A)
B)
C)
<strong>Which of the following is not a parse tree of an expression based on the following grammar?  </strong> A) B) C)
<strong>Which of the following is not a parse tree of an expression based on the following grammar?  </strong> A) B) C)
<strong>Which of the following is not a parse tree of an expression based on the following grammar?  </strong> A) B) C)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
17
Which of the following does not require a Boolean structure?

A) If-then-else statement
B) While loop statement
C) Assignment statement
D) For loop statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
18
Which of the following is an example of a language that is based on the object-oriented paradigm?

A) LISP
B) PROLOG
C) C
D) C++
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
19
Which of the following is not a step in the process of translating a program?

A) Executing the program
B) Parsing the program
C) Lexical analysis
D) Code generation
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which of the following is not a way of referring to a value in a program?

A) Variable
B) Literal
C) Constant
D) Type
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
21
Explain the distinction between the imperative and declarative programming paradigms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
22
In the context of the object-oriented paradigm, ____________ are templates from which
____________ are constructed. We say that the latter is an instance of the former.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
23
Explain why the generation approach to classifying programming languages fails to capture the full scope of today's languages.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
24
What general rule should be added to the Prolog program below so that Prolog can conclude that ice cream is better than spinach?
better(icecream, peanutbutter).
better(peanutbutter, spinach).
___________________________________________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
25
What does it mean to say that a programming language is machine independent?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
26
List four data types that occur as primitive types in many high-level programming languages.
____________________ ____________________
____________________ ____________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
27
Based on the Prolog program below, what goal should be used to find the siblings of sue? Based on the Prolog program below, what goal should be used to find the siblings of sue?   _________________________________________ _________________________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
28
To say that a grammar is ambiguous means that ___________________________________________
_____________________________________________________________________ .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
29
List two disadvantages of both machine languages and assembly languages that are overcome by high-level programming languages.
_____________________________________
_____________________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
30
Rewrite the following instructions using a single if-then-else statement. Rewrite the following instructions using a single if-then-else statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
31
Which of the following can Prolog conclude from the following program? parent(jill, sue).
Parent(jill, sally).
Parent(john, sue).
Parent(john, sally).
Sibling(X, Y) :- parent(Z, X), parent(Z, Y).

A) parent(jill, john)
B) sister(sue, sally)
C) sibling(sue, sally)
D) sibling(jill, sue)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
32
A data structure in which all elements have the same type is called ___________________, whereas a ________________ may have elements of different types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
33
What clause would produce the resolvent
P OR R OR S
when resolved with the clause
P OR \rightharpoondown Q
__________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
34
In addition to the procedure's name, what other information is contained in a typical procedure header?
____________________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
35
Based on the sketch of a class definition below, which methods can be invoked from outside an instance of the class? Based on the sketch of a class definition below, which methods can be invoked from outside an instance of the class?   _________________________________________________________ _________________________________________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
36
Why is the straightforward "goto" statement no longer popular in high-level programming languages?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
37
In contrast to _______________ languages such as English and Spanish, programming languages are
considered _______________ languages and are rigorously defined by their grammars.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
38
In the context of the object-oriented paradigm, a __________________ is an imperative program unit that describes how an object should react to a particular stimulus.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
39
Explain the distinction between translating a program (in a high-level language) and interpreting the program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
40
Explain the distinction between a formal parameter and an actual parameter.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
41
Explain the distinction between a procedure and a function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
42
Based on the grammar below, draw a parse tree showing that the string "drip drip drip" is a Leak. Based on the grammar below, draw a parse tree showing that the string drip drip drip is a Leak.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
43
Explain why key words in a programming language are often reserved words.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
44
Show that the grammar below is ambiguous by drawing two distinct parse trees for the string "drip drip drip." Show that the grammar below is ambiguous by drawing two distinct parse trees for the string drip drip drip.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
45
Explain the distinction between global and local variables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
46
In the context of the object-oriented paradigm, what is a constructor?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.