TRUE OR FALSE Flashcards

(46 cards)

1
Q

The extraction operator&raquo_space; skips all leading whitespace characters when searching for the next data in the input stream

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In the statement cin&raquo_space; x;, x must be a variable.

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The statement cin&raquo_space; x&raquo_space; y; requires the input values for x and y to appear on the same line.

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The statement cin&raquo_space; num; is equivalent to the statement num&raquo_space; cin;

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

You generate the newline character by pressing the Enter (return) key
on the keyboard.

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The function ignore is used to skip certain input in a line.

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The result of a logical expression cannot be assigned to an int variable

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In a one-way selection, if a semicolon is placed after the expression in
an if statement, the expression in the if statement is always true.

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Every if statement must have a corresponding else.

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The expression in the if statement:
if (score = 30)
grade = ‘A’;
always evaluates to true.

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The expression:
(ch >= ‘A’ && ch <= ‘Z’)
evaluates to false if either ch < ‘A’ or ch >= ‘Z’.

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Suppose the input is 5. The output of the code:
cin&raquo_space; num;
if (num > 5)
cout &laquo_space;num;
num = 0;
else
cout &laquo_space;“Num is zero” &laquo_space;endl;
is: Num is zero

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The expression in a switch statement should evaluate to a value of the
simple data type.

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The expression !(x > 0) is true only if x is a negative number.

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In C++, both ! and != are logical operators.

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The order in which statements execute in a program is called the flow of control.

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

In a counter-controlled while loop, it is not necessary to initialize the
loop control variable.

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

It is possible that the body of a while loop may not execute at all

A

FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

In an infinite while loop, the while expression (the decision maker) is
initially false, but after the first iteration it is always true

20
Q

The while loop:
j = 0;
while (j <= 10)
j++;
terminates if j > 10

21
Q

A sentinel-controlled while loop is an event-controlled while loop
whose termination depends on a special value.

22
Q

A loop is a control structure that causes certain statements to execute
over and over.

23
Q

To read data from a file of an unspecified length, an EOF-controlled
loop is a good choice.

24
Q

When a while loop terminates, the control first goes back to the
statement just before the while statement, and then the control goes
to the statement immediately following the while loop.

25
An identifier can be any sequence of digits and letters.
FALSE
26
In C++, there is no difference between a reserved word and a predefined identifier
FALSE
27
A C++ identifier can start with a digit.
FALSE
28
The operands of the modulus operator must be integers.
TRUE
29
If a = 4; and b = 3;, then after the statement a = b; the value of b is still 3.
TRUE
30
In the statement cin >> y;, y can only be an int or a double variable.
FALSE
31
In an output statement, the newline character may be a part of the string.
TRUE
32
The following is a legal C++ program: int main() { return 0; }
TRUE
33
In a mixed expression, all the operands are converted to floating-point numbers.
FALSE
34
Suppose x = 5. After the statement y = x++; executes, y is 5 and x is 6.
TRUE
35
Suppose a = 5. After the statement ++a; executes, the value of a is still 5 because the value of the expression is not saved in another variable.
FALSE
36
The first device known to carry out calculations was the Pascaline
FALSE - answer: abacus
37
Modern-day computers can accept spoken-word instructions but cannot imitate human reasoning.
FALSE - answer: and can imitate human reasoning through artificial intelligence.
38
In ASCII coding, every character is coded as a sequence of 8 bits.
TRUE
39
A compiler translates a high-level program into assembly language.
FALSE - answer: translates high-level program (source code) into machine code
40
The arithmetic operations are performed inside CPU, and if an error is found, it outputs the logical errors
FALSE - answer: compiler (not sure of this answer)
41
A sequence of 0s and 1s is called a decimal code.
FALSE - answer: binary code or binary number
42
A linker links and loads the object code from main memory into the CPU for execution.
FALSE - answer: A linker is a program that combines the object program with other programs in the library and is used in the program to create the executable code.
43
Development of a C++ program includes six steps.
True
44
A program written in a high-level programming language is called a source program.
True
45
ZB stands for zero byte
False. Zettabyte (sextillion)
46
The first step in the problem-solving process is to analyze the problem
True