CS 159 Lab 6

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 22

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

23 Terms

1

A piece of data is called logical if it conveys the idea of true or false.

true

New cards
2

C programmers use other types, such as integers, to represent logical data.

true

New cards
3

If a data value is zero it is considered false, but any non-zero value is considered true.

true

New cards
4

The logical AND (&&) operator is true only when both operands are true.

true

New cards
5

The logical OR (||) operator is true only when exactly one of its operands is true

false; could be both are true

New cards
6

The AND and OR operator share the same level of operator precedence.

false; AND is higher

New cards
7

The short-circuit method of evaluating logical expressions will stop evaluating the current expression as soon as the result can be determined.

true

New cards
8

Relational Operators

less than, greater than, <=, >=; higher precedence than the equality operators

New cards
9

Equality Operators

==, !=; lower precedence than relational

New cards
10

The complement of the equal operator is the not equal operator.

true

New cards
11

The complement of the greater than operator is the less than operator.

false; less than equal to operator

New cards
12

When attempting to print the result of a logical expression that is true as an integer the result will always be 1.

true

New cards
13

The logical expression of an if...else construct must be enclosed in parentheses.

true

New cards
14

There is no semi-colon that follows the logical expression of an if...else construct.

true

New cards
15

The statements found inside of an if...else may be any statement, including another if...else construct.

true

New cards
16

if(a != 0) and if(!a) are equivalent statements.

false; complements

New cards
17

if(a == 0) and if(a) are equivalent statements.

false; complements

New cards
18

The conditional expression is a two-way selection construct

true

New cards
19

Negative logic refers to any expression that begins with a NOT operator or that contains multiple NOT operators within.

true

New cards
20

Complementing a condition is one way to potentially remove negative logic from an expression.

true

New cards
21

The only way to complement a NOT operator is with another NOT operator

false

New cards
22

When writing a selection construct the most probable conditions should come before those that occur less frequently.

true

New cards
23

It is possible to indicate on a structure chart when a user-defined is called from within a section construct.

true

New cards

Explore top notes

note Note
studied byStudied by 6 people
888 days ago
5.0(1)
note Note
studied byStudied by 13 people
330 days ago
5.0(1)
note Note
studied byStudied by 4 people
839 days ago
5.0(1)
note Note
studied byStudied by 1 person
809 days ago
5.0(1)
note Note
studied byStudied by 1 person
58 days ago
5.0(1)
note Note
studied byStudied by 8 people
788 days ago
5.0(1)
note Note
studied byStudied by 165 people
115 days ago
4.0(1)

Explore top flashcards

flashcards Flashcard (37)
studied byStudied by 16 people
792 days ago
4.7(3)
flashcards Flashcard (130)
studied byStudied by 3 people
672 days ago
5.0(1)
flashcards Flashcard (49)
studied byStudied by 4 people
120 days ago
5.0(1)
flashcards Flashcard (88)
studied byStudied by 170 people
547 days ago
5.0(3)
flashcards Flashcard (57)
studied byStudied by 1 person
29 days ago
5.0(2)
flashcards Flashcard (77)
studied byStudied by 8 people
493 days ago
5.0(1)
flashcards Flashcard (24)
studied byStudied by 3 people
833 days ago
5.0(1)
flashcards Flashcard (163)
studied byStudied by 185 people
421 days ago
5.0(1)
robot