TRUE OR FALSE Flashcards

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

A

FALSE

20
Q

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

A

TRUE

21
Q

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

A

TRUE

22
Q

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

A

TRUE

23
Q

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

A

TRUE

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.

A

FALSE

25
Q

An identifier can be any sequence of digits and letters.

A

FALSE

26
Q

In C++, there is no difference between a reserved word and a predefined identifier

A

FALSE

27
Q

A C++ identifier can start with a digit.

A

FALSE

28
Q

The operands of the modulus operator must be integers.

A

TRUE

29
Q

If a = 4; and b = 3;, then after the statement a = b; the value of b is still 3.

A

TRUE

30
Q

In the statement cin&raquo_space; y;, y can only be an int or a double variable.

A

FALSE

31
Q

In an output statement, the newline character may be a part of the string.

A

TRUE

32
Q

The following is a legal C++ program:
int main()
{
return 0;
}

A

TRUE

33
Q

In a mixed expression, all the operands are converted to floating-point numbers.

A

FALSE

34
Q

Suppose x = 5. After the statement y = x++; executes, y is 5 and x is 6.

A

TRUE

35
Q

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.

A

FALSE

36
Q

The first device known to carry out calculations was the Pascaline

A

FALSE - answer: abacus

37
Q

Modern-day computers can accept spoken-word instructions but cannot
imitate human reasoning.

A

FALSE - answer: and can imitate human reasoning through artificial intelligence.

38
Q

In ASCII coding, every character is coded as a sequence of 8 bits.

A

TRUE

39
Q

A compiler translates a high-level program into assembly language.

A

FALSE - answer: translates high-level program (source code) into machine code

40
Q

The arithmetic operations are performed inside CPU, and if an error is found, it outputs the logical errors

A

FALSE - answer: compiler (not sure of this answer)

41
Q

A sequence of 0s and 1s is called a decimal code.

A

FALSE - answer: binary code or binary number

42
Q

A linker links and loads the object code from main memory into the CPU
for execution.

A

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
Q

Development of a C++ program includes six steps.

A

True

44
Q

A program written in a high-level programming language is called a source program.

A

True

45
Q

ZB stands for zero byte

A

False. Zettabyte (sextillion)

46
Q

The first step in the problem-solving process is to analyze the problem

A

True