Deck 2: Basic Elements of C

ملء الشاشة (f)
exit full mode
سؤال
A comma is also called a statement terminator.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
____ is a valid char value.

A) -129
B) 'A'
C) 128
D) 129
سؤال
If a C++ arithmetic expression has no parentheses, operators are evaluated from left to right.
سؤال
Which of the following is a reserved word in C++?

A) char
B) Char
C) CHAR
D) character
سؤال
The memory allocated for a float value is ____ bytes.

A) two
B) four
C) eight
D) sixteen
سؤال
The expression static_cast(9.9) evaluates to ____.

A) 9
B) 10
C) 9.9
D) 9.0
سؤال
An example of a floating point data type is ____.

A) int
B) char
C) double
D) short
سؤال
The ____ rules of a programming language tell you which statements are legal, or accepted by the programming language.

A) semantic
B) logical
C) syntax
D) grammatical
سؤال
The maximum number of significant digits in float values is up to 6 or 7.
سؤال
Suppose a = 5. After the execution of the statement ++a; the value of a is 6.
سؤال
The value of the expression 17 % 7 is ____.

A) 1
B) 2
C) 3
D) 4
سؤال
In C++, reserved words are the same as predefined identifiers.
سؤال
The escape sequence \r moves the insertion point to the beginning of the next line.
سؤال
Which of the following is a legal identifier?

A) program!
B) program_1
C) 1program
D) program 1
سؤال
The maximum number of significant digits in values of the double type is 15.
سؤال
A mixed arithmetic expression contains all operands of the same type.
سؤال
An operator that has only one operand is called a unique operator.
سؤال
____ is a valid int value.

A) 46,259
B) 46259
C) 462.59
D) -32.00
سؤال
The value of the expression 33/10, assuming both values are integral data types, is ____.

A) 0.3
B) 3
C) 3.0
D) 3.3
سؤال
Suppose that sum is an int variable. The statement sum += 7; is equivalent to the statement sum = sum + 7;
سؤال
In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After the statement cin >> one >> two; executes, ____.

A) one = 10.5, two = 10.5
B) one = 10.5, two = 30.6
C) one = 30.6, two = 30.6
D) one = 11, two = 31
سؤال
____________________ is the process of planning and creating a program.
سؤال
A(n) ____________________ is a memory location whose contents can be changed.
سؤال
Suppose that sum and num are int variables and sum = 5 and num = 10. After the statement sum += num executes, ____.

A) sum = 0
B) sum = 5
C) sum = 10
D) sum = 15
سؤال
Suppose that alpha and beta are int variables and alpha = 5 and beta = 10. After the statement alpha *= beta; executes, ____.

A) alpha = 5
B) alpha = 10
C) alpha = 50
D) alpha = 50.0
سؤال
____________________ functions are those that have already been written and are provided as part of the system.
سؤال
Choose the output of the following C++ statement: cout << "Sunny " << '\n' << "Day " << endl;

A) Sunny \nDay
B) Sunny \nDay endl
C) Sunny
Day
D) Sunny \n
Day
سؤال
____ are executable statements that inform the user what to do.

A) Variables
B) Prompt lines
C) Named constants
D) Expressions
سؤال
A(n) ____________________ is a collection of statements, and when it is activated, or executed, it accomplishes something.
سؤال
Suppose that alpha and beta are int variables. The statement alpha = beta--; is equivalent to the statement(s) ____.

A) alpha = 1 - beta;
B) alpha = beta - 1;
C) beta = beta - 1;
Alpha = beta;
D) alpha = beta;
Beta = beta - 1;
سؤال
Which of the following is the newline character?

A) \r
B) \n
C) \l
D) \b
سؤال
Suppose that alpha and beta are int variables. The statement alpha = beta++; is equivalent to the statement(s) ____.

A) alpha = 1 + beta;
B) alpha = alpha + beta;
C) alpha = beta;
Beta = beta + 1;
D) beta = beta + 1;
Alpha = beta;
سؤال
____________________ rules determine the meaning of instructions.
سؤال
Suppose that alpha and beta are int variables. The statement alpha = ++beta; is equivalent to the statement(s) ____.

A) beta = beta + 1;
Alpha = beta;
B) alpha = beta;
Beta = beta + 1;
C) alpha = alpha + beta;
D) alpha = beta + 1;
سؤال
The expression static_cast(6.9) + static_cast(7.9) evaluates to ____.

A) 13
B) 14
C) 14.8
D) 15
سؤال
The length of the string "computer science" is ____.

A) 14
B) 15
C) 16
D) 18
سؤال
Suppose that count is an int variable and count = 1. After the statement count++; executes, the value of count is ____.

A) 1
B) 2
C) 3
D) 4
سؤال
The declaration int a, b, c; is equivalent to which of the following?

A) inta , b, c;
B) int a,b,c;
C) int abc;
D) int a b c;
سؤال
Suppose that alpha and beta are int variables. The statement alpha = --beta; is equivalent to the statement(s) ____.

A) alpha = 1 - beta;
B) alpha = beta - 1;
C) beta = beta - 1;
Alpha = beta;
D) alpha = beta;
Beta = beta - 1;
سؤال
Consider the following code. // Insertion Point 1
Using namespace std;
Const float PI = 3.14;
Int main()
{
//Insertion Point 2
Float r = 2.0;
Float area;
Area = PI * r * r;
Cout << "Area = " << area <Return 0;
}
// Insertion Point 3
In this code, where does the include statement belong?

A) Insertion Point 1
B) Insertion Point 2
C) Insertion Point 3
D) Anywhere in the program
سؤال
A data type is called ____________________ if the variable or named constant of that type can store only one value at a time.
سؤال
A(n) ____________________ is a sequence of zero or more characters.
سؤال
The maximum number of significant digits is called the ____________________.
سؤال
The ____________________ type is C++ 's method for allowing programmers to create their own simple data types.
سؤال
In C++, you can use a(n) ____________________ to instruct a program to mark those memory locations in which data is fixed throughout program execution.
سؤال
____________________ can be used to identify the authors of the program, give the date when the program is written or modified, give a brief explanation of the program, and explain the meaning of key statements in a program.
سؤال
The smallest individual unit of a program written in any language is called a(n) ____________________.
سؤال
When a value of one data type is automatically changed to another data type, a(n) ____________________ type coercion is said to have occurred.
سؤال
In a C++ program, ____________________ are used to separate special symbols, reserved words, and identifiers.
سؤال
The memory space for a(n) ____________________ data value is 64 bytes.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 2: Basic Elements of C
1
A comma is also called a statement terminator.
False
2
____ is a valid char value.

A) -129
B) 'A'
C) 128
D) 129
B
3
If a C++ arithmetic expression has no parentheses, operators are evaluated from left to right.
True
4
Which of the following is a reserved word in C++?

A) char
B) Char
C) CHAR
D) character
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
5
The memory allocated for a float value is ____ bytes.

A) two
B) four
C) eight
D) sixteen
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
6
The expression static_cast(9.9) evaluates to ____.

A) 9
B) 10
C) 9.9
D) 9.0
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
7
An example of a floating point data type is ____.

A) int
B) char
C) double
D) short
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
8
The ____ rules of a programming language tell you which statements are legal, or accepted by the programming language.

A) semantic
B) logical
C) syntax
D) grammatical
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
9
The maximum number of significant digits in float values is up to 6 or 7.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
10
Suppose a = 5. After the execution of the statement ++a; the value of a is 6.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
11
The value of the expression 17 % 7 is ____.

A) 1
B) 2
C) 3
D) 4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
12
In C++, reserved words are the same as predefined identifiers.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
13
The escape sequence \r moves the insertion point to the beginning of the next line.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
14
Which of the following is a legal identifier?

A) program!
B) program_1
C) 1program
D) program 1
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
15
The maximum number of significant digits in values of the double type is 15.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
16
A mixed arithmetic expression contains all operands of the same type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
17
An operator that has only one operand is called a unique operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
18
____ is a valid int value.

A) 46,259
B) 46259
C) 462.59
D) -32.00
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
19
The value of the expression 33/10, assuming both values are integral data types, is ____.

A) 0.3
B) 3
C) 3.0
D) 3.3
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
20
Suppose that sum is an int variable. The statement sum += 7; is equivalent to the statement sum = sum + 7;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
21
In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After the statement cin >> one >> two; executes, ____.

A) one = 10.5, two = 10.5
B) one = 10.5, two = 30.6
C) one = 30.6, two = 30.6
D) one = 11, two = 31
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
22
____________________ is the process of planning and creating a program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
23
A(n) ____________________ is a memory location whose contents can be changed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
24
Suppose that sum and num are int variables and sum = 5 and num = 10. After the statement sum += num executes, ____.

A) sum = 0
B) sum = 5
C) sum = 10
D) sum = 15
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
25
Suppose that alpha and beta are int variables and alpha = 5 and beta = 10. After the statement alpha *= beta; executes, ____.

A) alpha = 5
B) alpha = 10
C) alpha = 50
D) alpha = 50.0
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
26
____________________ functions are those that have already been written and are provided as part of the system.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
27
Choose the output of the following C++ statement: cout << "Sunny " << '\n' << "Day " << endl;

A) Sunny \nDay
B) Sunny \nDay endl
C) Sunny
Day
D) Sunny \n
Day
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
28
____ are executable statements that inform the user what to do.

A) Variables
B) Prompt lines
C) Named constants
D) Expressions
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
29
A(n) ____________________ is a collection of statements, and when it is activated, or executed, it accomplishes something.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
30
Suppose that alpha and beta are int variables. The statement alpha = beta--; is equivalent to the statement(s) ____.

A) alpha = 1 - beta;
B) alpha = beta - 1;
C) beta = beta - 1;
Alpha = beta;
D) alpha = beta;
Beta = beta - 1;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
31
Which of the following is the newline character?

A) \r
B) \n
C) \l
D) \b
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
32
Suppose that alpha and beta are int variables. The statement alpha = beta++; is equivalent to the statement(s) ____.

A) alpha = 1 + beta;
B) alpha = alpha + beta;
C) alpha = beta;
Beta = beta + 1;
D) beta = beta + 1;
Alpha = beta;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
33
____________________ rules determine the meaning of instructions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
34
Suppose that alpha and beta are int variables. The statement alpha = ++beta; is equivalent to the statement(s) ____.

A) beta = beta + 1;
Alpha = beta;
B) alpha = beta;
Beta = beta + 1;
C) alpha = alpha + beta;
D) alpha = beta + 1;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
35
The expression static_cast(6.9) + static_cast(7.9) evaluates to ____.

A) 13
B) 14
C) 14.8
D) 15
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
36
The length of the string "computer science" is ____.

A) 14
B) 15
C) 16
D) 18
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
37
Suppose that count is an int variable and count = 1. After the statement count++; executes, the value of count is ____.

A) 1
B) 2
C) 3
D) 4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
38
The declaration int a, b, c; is equivalent to which of the following?

A) inta , b, c;
B) int a,b,c;
C) int abc;
D) int a b c;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
39
Suppose that alpha and beta are int variables. The statement alpha = --beta; is equivalent to the statement(s) ____.

A) alpha = 1 - beta;
B) alpha = beta - 1;
C) beta = beta - 1;
Alpha = beta;
D) alpha = beta;
Beta = beta - 1;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
40
Consider the following code. // Insertion Point 1
Using namespace std;
Const float PI = 3.14;
Int main()
{
//Insertion Point 2
Float r = 2.0;
Float area;
Area = PI * r * r;
Cout << "Area = " << area <Return 0;
}
// Insertion Point 3
In this code, where does the include statement belong?

A) Insertion Point 1
B) Insertion Point 2
C) Insertion Point 3
D) Anywhere in the program
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
41
A data type is called ____________________ if the variable or named constant of that type can store only one value at a time.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
42
A(n) ____________________ is a sequence of zero or more characters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
43
The maximum number of significant digits is called the ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
44
The ____________________ type is C++ 's method for allowing programmers to create their own simple data types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
45
In C++, you can use a(n) ____________________ to instruct a program to mark those memory locations in which data is fixed throughout program execution.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
46
____________________ can be used to identify the authors of the program, give the date when the program is written or modified, give a brief explanation of the program, and explain the meaning of key statements in a program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
47
The smallest individual unit of a program written in any language is called a(n) ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
48
When a value of one data type is automatically changed to another data type, a(n) ____________________ type coercion is said to have occurred.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
49
In a C++ program, ____________________ are used to separate special symbols, reserved words, and identifiers.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
50
The memory space for a(n) ____________________ data value is 64 bytes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.