Deck 2: Evaluating C Expressions

ملء الشاشة (f)
exit full mode
سؤال
____ is not a valid operator in C++.

A) &
B) %=
C) ++
D) =+
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
You can isolate the last digit of a base-10 number by performing modulus with ____.

A) 1
B) 2
C) 10
D) 100
سؤال
When you use the += operator, you may insert a space between the + and the =.
سؤال
When an expression includes a(n) ____ operator, the mathematical operation takes place after the expression is evaluated.

A) prefix
B) postfix
C) unary
D) binary
سؤال
Multiplication, division, and modulus are said to have higher ____ than addition or subtraction.

A) priority
B) unifying factor
C) cast value
D) arithmetic precedence
سؤال
C++ provides ____ simple arithmetic operators for creating arithmetic expressions.

A) three
B) four
C) five
D) six
سؤال
The result of evaluating 3.0 / 4 + 2.2 is ____.

A) 2
B) 2.2
C) 2.95
D) 2.99
سؤال
When you mix data types in a binary arithmetic expression, the values on each side of the arithmetic operator are temporarily converted to a ____ type-the data type of the value that occupies more memory and to which all the types in the expression are converted.

A) unifying
B) standard
C) common
D) large
سؤال
The result of evaluating 3 / 4 + 2.2 is ____.

A) 2
B) 2.2
C) 2.95
D) 2.99
سؤال
The address operator (____) is a C++ unary operator that is not available for use in most other programming languages.

A) *
B) **
C) &
D) %
سؤال
When more than one arithmetic operator is included in an expression, then multiplication, division, and modulus operations always occur before addition or subtraction.
سؤال
When an expression includes a(n) ____ operator, the mathematical operation takes place before the expression is evaluated.

A) prefix
B) postfix
C) unary
D) binary
سؤال
The C++ modulus operator is ____.

A) &
B) #
C) !
D) %
سؤال
When two operations with the same precedence appear in an arithmetic expression, the operations are carried out in order from either left to right or right to left based on their ____.

A) associativity
B) precedence
C) unifying factor
D) modulus
سؤال
The modulus operator gives the remainder of integer division; it can be used only with integers.
سؤال
All precedence rules can be overridden with appropriately placed ____.

A) colons
B) semicolons
C) casts
D) parentheses
سؤال
All arithmetic operators are binary.
سؤال
The associativity of arithmetic operations (if there are no parentheses in the expression) is from right to left.
سؤال
To ____ a value is to transform it to another data type.

A) reduce
B) cast
C) convert
D) unify
سؤال
A(n) ____ is a digit added to a number (either at the end or at the beginning) that validates the authenticity of the number.

A) checksum
B) check digit
C) error detection code
D) CRC
سؤال
Consider the following line of C++ code:
float g = 2.0f, h = 4.4f, i = 12.8f, floatResult;
What is the purpose of the lowercase f's (e.g. 2.0 f )?
سؤال
A(n) ____________________ is a symbol that performs arithmetic.
سؤال
A(n) ____________________ is an operator that takes two operands, one on each side of the operator.
سؤال
A ____ expression is one that is interpreted to be true or false.

A) binary
B) mathematical
C) Boolean
D) unary
سؤال
____________________ are those that require only one operand.
سؤال
When you use ____________________ in front of a variable name, you refer to the memory address of that variable rather than the contents of the variable.
سؤال
Write the following operators in order of precedence, from highest to lowest:
float
int
doable
char
unsigned long
long double
long
short
unsigned int
سؤال
What is the hexadecimal numbering system? When is it typically used?
سؤال
Explain what the following statement means: "If you will use a calculated value later in a program, it is inefficient not to store it."
سؤال
Explain why using modulus with negative numbers can lead to unexpected results.
سؤال
What are the relational operators in C++?
سؤال
The expression cout 2); yields ____ as output.

A) 0
B) 1
C) true
D) false
سؤال
(4 - 4) = = 0 evaluates to ____.

A) 0
B) 1
C) true
D) false
سؤال
The unary operator ____ is the not operator; it means "the opposite of," and essentially reverses the true/false value of an expression.

A) !
B) &
C) %
D) $
سؤال
The two categories of shortcut arithmetic operators are ____________________ operators and increment and decrement operators.
سؤال
How can you perform an explicit cast?
سؤال
____ operators evaluate the relationship between operands; you use them with Boolean expressions.

A) Relational
B) Logical
C) Boolean
D) Mathematical
سؤال
A(n) ____________________ is a deliberate cast (as opposed to an automatic one).
سؤال
What should you keep in mind when dividing integers?
سؤال
!5 evaluates to ____.

A) -1
B) 0
C) 1
D) N/A
سؤال
Match between columns
positive value operator when used alone in front of an operand
mixed expression
positive value operator when used alone in front of an operand
long double
positive value operator when used alone in front of an operand
%=
positive value operator when used alone in front of an operand
char
positive value operator when used alone in front of an operand
associativity
positive value operator when used alone in front of an operand
count++
positive value operator when used alone in front of an operand
+
positive value operator when used alone in front of an operand
++count
positive value operator when used alone in front of an operand
implicit cast
سؤال
Match between columns
postfix increment operator
mixed expression
postfix increment operator
long double
postfix increment operator
%=
postfix increment operator
char
postfix increment operator
associativity
postfix increment operator
count++
postfix increment operator
+
postfix increment operator
++count
postfix increment operator
implicit cast
سؤال
Match between columns
prefix increment operator
mixed expression
prefix increment operator
long double
prefix increment operator
%=
prefix increment operator
char
prefix increment operator
associativity
prefix increment operator
count++
prefix increment operator
+
prefix increment operator
++count
prefix increment operator
implicit cast
سؤال
What is a common C++ programming error when comparing two values in C++?
سؤال
Match between columns
modulus and assign operator
mixed expression
modulus and assign operator
long double
modulus and assign operator
%=
modulus and assign operator
char
modulus and assign operator
associativity
modulus and assign operator
count++
modulus and assign operator
+
modulus and assign operator
++count
modulus and assign operator
implicit cast
سؤال
What are static fields?
سؤال
Match between columns
rule that dictates the order in which an operator works with its operands
mixed expression
rule that dictates the order in which an operator works with its operands
long double
rule that dictates the order in which an operator works with its operands
%=
rule that dictates the order in which an operator works with its operands
char
rule that dictates the order in which an operator works with its operands
associativity
rule that dictates the order in which an operator works with its operands
count++
rule that dictates the order in which an operator works with its operands
+
rule that dictates the order in which an operator works with its operands
++count
rule that dictates the order in which an operator works with its operands
implicit cast
سؤال
Match between columns
is performed automatically and without your intervention
mixed expression
is performed automatically and without your intervention
long double
is performed automatically and without your intervention
%=
is performed automatically and without your intervention
char
is performed automatically and without your intervention
associativity
is performed automatically and without your intervention
count++
is performed automatically and without your intervention
+
is performed automatically and without your intervention
++count
is performed automatically and without your intervention
implicit cast
سؤال
Match between columns
has the lowest precedence of the unifying types
%=
has the lowest precedence of the unifying types
mixed expression
has the lowest precedence of the unifying types
long double
has the lowest precedence of the unifying types
char
has the lowest precedence of the unifying types
associativity
has the lowest precedence of the unifying types
count++
has the lowest precedence of the unifying types
+
has the lowest precedence of the unifying types
++count
has the lowest precedence of the unifying types
implicit cast
سؤال
Match between columns
has the highest precedence of the unifying types
mixed expression
has the highest precedence of the unifying types
long double
has the highest precedence of the unifying types
%=
has the highest precedence of the unifying types
char
has the highest precedence of the unifying types
associativity
has the highest precedence of the unifying types
count++
has the highest precedence of the unifying types
+
has the highest precedence of the unifying types
++count
has the highest precedence of the unifying types
implicit cast
سؤال
Match between columns
for example, 3.2 * 2
mixed expression
for example, 3.2 * 2
long double
for example, 3.2 * 2
%=
for example, 3.2 * 2
char
for example, 3.2 * 2
associativity
for example, 3.2 * 2
count++
for example, 3.2 * 2
+
for example, 3.2 * 2
++count
for example, 3.2 * 2
implicit cast
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/51
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 2: Evaluating C Expressions
1
____ is not a valid operator in C++.

A) &
B) %=
C) ++
D) =+
D
2
You can isolate the last digit of a base-10 number by performing modulus with ____.

A) 1
B) 2
C) 10
D) 100
C
3
When you use the += operator, you may insert a space between the + and the =.
False
4
When an expression includes a(n) ____ operator, the mathematical operation takes place after the expression is evaluated.

A) prefix
B) postfix
C) unary
D) binary
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
5
Multiplication, division, and modulus are said to have higher ____ than addition or subtraction.

A) priority
B) unifying factor
C) cast value
D) arithmetic precedence
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
6
C++ provides ____ simple arithmetic operators for creating arithmetic expressions.

A) three
B) four
C) five
D) six
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
7
The result of evaluating 3.0 / 4 + 2.2 is ____.

A) 2
B) 2.2
C) 2.95
D) 2.99
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
8
When you mix data types in a binary arithmetic expression, the values on each side of the arithmetic operator are temporarily converted to a ____ type-the data type of the value that occupies more memory and to which all the types in the expression are converted.

A) unifying
B) standard
C) common
D) large
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
9
The result of evaluating 3 / 4 + 2.2 is ____.

A) 2
B) 2.2
C) 2.95
D) 2.99
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
10
The address operator (____) is a C++ unary operator that is not available for use in most other programming languages.

A) *
B) **
C) &
D) %
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
11
When more than one arithmetic operator is included in an expression, then multiplication, division, and modulus operations always occur before addition or subtraction.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
12
When an expression includes a(n) ____ operator, the mathematical operation takes place before the expression is evaluated.

A) prefix
B) postfix
C) unary
D) binary
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
13
The C++ modulus operator is ____.

A) &
B) #
C) !
D) %
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
14
When two operations with the same precedence appear in an arithmetic expression, the operations are carried out in order from either left to right or right to left based on their ____.

A) associativity
B) precedence
C) unifying factor
D) modulus
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
15
The modulus operator gives the remainder of integer division; it can be used only with integers.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
16
All precedence rules can be overridden with appropriately placed ____.

A) colons
B) semicolons
C) casts
D) parentheses
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
17
All arithmetic operators are binary.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
18
The associativity of arithmetic operations (if there are no parentheses in the expression) is from right to left.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
19
To ____ a value is to transform it to another data type.

A) reduce
B) cast
C) convert
D) unify
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
20
A(n) ____ is a digit added to a number (either at the end or at the beginning) that validates the authenticity of the number.

A) checksum
B) check digit
C) error detection code
D) CRC
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
21
Consider the following line of C++ code:
float g = 2.0f, h = 4.4f, i = 12.8f, floatResult;
What is the purpose of the lowercase f's (e.g. 2.0 f )?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
22
A(n) ____________________ is a symbol that performs arithmetic.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
23
A(n) ____________________ is an operator that takes two operands, one on each side of the operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
24
A ____ expression is one that is interpreted to be true or false.

A) binary
B) mathematical
C) Boolean
D) unary
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
25
____________________ are those that require only one operand.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
26
When you use ____________________ in front of a variable name, you refer to the memory address of that variable rather than the contents of the variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
27
Write the following operators in order of precedence, from highest to lowest:
float
int
doable
char
unsigned long
long double
long
short
unsigned int
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
28
What is the hexadecimal numbering system? When is it typically used?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
29
Explain what the following statement means: "If you will use a calculated value later in a program, it is inefficient not to store it."
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
30
Explain why using modulus with negative numbers can lead to unexpected results.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
31
What are the relational operators in C++?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
32
The expression cout 2); yields ____ as output.

A) 0
B) 1
C) true
D) false
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
33
(4 - 4) = = 0 evaluates to ____.

A) 0
B) 1
C) true
D) false
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
34
The unary operator ____ is the not operator; it means "the opposite of," and essentially reverses the true/false value of an expression.

A) !
B) &
C) %
D) $
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
35
The two categories of shortcut arithmetic operators are ____________________ operators and increment and decrement operators.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
36
How can you perform an explicit cast?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
37
____ operators evaluate the relationship between operands; you use them with Boolean expressions.

A) Relational
B) Logical
C) Boolean
D) Mathematical
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
38
A(n) ____________________ is a deliberate cast (as opposed to an automatic one).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
39
What should you keep in mind when dividing integers?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
40
!5 evaluates to ____.

A) -1
B) 0
C) 1
D) N/A
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
41
Match between columns
positive value operator when used alone in front of an operand
mixed expression
positive value operator when used alone in front of an operand
long double
positive value operator when used alone in front of an operand
%=
positive value operator when used alone in front of an operand
char
positive value operator when used alone in front of an operand
associativity
positive value operator when used alone in front of an operand
count++
positive value operator when used alone in front of an operand
+
positive value operator when used alone in front of an operand
++count
positive value operator when used alone in front of an operand
implicit cast
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
42
Match between columns
postfix increment operator
mixed expression
postfix increment operator
long double
postfix increment operator
%=
postfix increment operator
char
postfix increment operator
associativity
postfix increment operator
count++
postfix increment operator
+
postfix increment operator
++count
postfix increment operator
implicit cast
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
43
Match between columns
prefix increment operator
mixed expression
prefix increment operator
long double
prefix increment operator
%=
prefix increment operator
char
prefix increment operator
associativity
prefix increment operator
count++
prefix increment operator
+
prefix increment operator
++count
prefix increment operator
implicit cast
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
44
What is a common C++ programming error when comparing two values in C++?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
45
Match between columns
modulus and assign operator
mixed expression
modulus and assign operator
long double
modulus and assign operator
%=
modulus and assign operator
char
modulus and assign operator
associativity
modulus and assign operator
count++
modulus and assign operator
+
modulus and assign operator
++count
modulus and assign operator
implicit cast
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
46
What are static fields?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
47
Match between columns
rule that dictates the order in which an operator works with its operands
mixed expression
rule that dictates the order in which an operator works with its operands
long double
rule that dictates the order in which an operator works with its operands
%=
rule that dictates the order in which an operator works with its operands
char
rule that dictates the order in which an operator works with its operands
associativity
rule that dictates the order in which an operator works with its operands
count++
rule that dictates the order in which an operator works with its operands
+
rule that dictates the order in which an operator works with its operands
++count
rule that dictates the order in which an operator works with its operands
implicit cast
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
48
Match between columns
is performed automatically and without your intervention
mixed expression
is performed automatically and without your intervention
long double
is performed automatically and without your intervention
%=
is performed automatically and without your intervention
char
is performed automatically and without your intervention
associativity
is performed automatically and without your intervention
count++
is performed automatically and without your intervention
+
is performed automatically and without your intervention
++count
is performed automatically and without your intervention
implicit cast
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
49
Match between columns
has the lowest precedence of the unifying types
%=
has the lowest precedence of the unifying types
mixed expression
has the lowest precedence of the unifying types
long double
has the lowest precedence of the unifying types
char
has the lowest precedence of the unifying types
associativity
has the lowest precedence of the unifying types
count++
has the lowest precedence of the unifying types
+
has the lowest precedence of the unifying types
++count
has the lowest precedence of the unifying types
implicit cast
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
50
Match between columns
has the highest precedence of the unifying types
mixed expression
has the highest precedence of the unifying types
long double
has the highest precedence of the unifying types
%=
has the highest precedence of the unifying types
char
has the highest precedence of the unifying types
associativity
has the highest precedence of the unifying types
count++
has the highest precedence of the unifying types
+
has the highest precedence of the unifying types
++count
has the highest precedence of the unifying types
implicit cast
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
51
Match between columns
for example, 3.2 * 2
mixed expression
for example, 3.2 * 2
long double
for example, 3.2 * 2
%=
for example, 3.2 * 2
char
for example, 3.2 * 2
associativity
for example, 3.2 * 2
count++
for example, 3.2 * 2
+
for example, 3.2 * 2
++count
for example, 3.2 * 2
implicit cast
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.