Chapter 3 Fundamentals of Computing

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 / 26

encourage image

There's no tags or description

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

27 Terms

1

What type of structure can execute a set of statements only under certain circumstance?

Decision structure

New cards
2

When you assign a variable, calculating it's value, and outputting a result done in a step by step manner what is that called?

Sequence structure

New cards
3

What type of structure provides one alternative path of execution?

Single alternative decision structure

New cards
4

What kind of expression has value of either True or False?

Boolean expression

New cards
5

What type of operators are >, <, and == ?

Relational operators

New cards
6

What structure tests a condition and then takes one path if the condiion is true, or another path if the condition is false?

A dual alternative decision structure

New cards
7

What statement is used to write a single alternative decision structure?

If statement

New cards
8

What statement is used to write a dual alternative decision structure?

If-else statement

New cards
9

What type of operator are and, or , and not?

Logical operators

New cards
10

What compound Boolean expression created with which operator is true only if both of its subexpressions are true?

AND operator

New cards
11

A compound Boolean expression created with which operator is true if either of its subexpressions is true?

OR operator

New cards
12

Which operator takes a Boolean expression as its operand and reverses its logical value?

NOT operator

New cards
13

What is a Boolean variable that signals when some condition exists in a program?

A FLAG

New cards
14

True or False: You can write any program using only sequence structures

FALSE: You need a decision structure and repetition structures for complex programs

New cards
15

True or False: A program can be made of only one type of CONTROL structure. You cannot combine structures.

FALSE: Programs often combine sequence, decision, and repetition structures

New cards
16

True or False: A single alternative decision structure tests a condition and then takes on path if the condition is true, or another path if the condition is false.

FALSE: A single alternative structure only takes action if the condition is true. A DUAL decision structure handles both true and false cases.

New cards
17

True or False: A decision structure can be nested inside another decision structure

True

New cards
18

True or False: A compound BOolean expression created with the "AND" operator is true only when both subexpressions are true

True

New cards
19

What is 'conditionally executed'?

Refers to a code that runs when a specific condition is met

New cards
20

You need to test a condition then execute one set of statements if the condition is true. If the condition is false, you need to execute a different set of statements. What structure will you use?

Dual alternative decision structure (if-else statement)

New cards
21

What is the AND operator?

The AND operator evaluates to True only if both of its subexpressions are True. If either of both subexpressions are False the result is False.

New cards
22

What is the OR operator?

The OR operator evaluates ti True if at least one of its subexpressions are True. It only evaluates False if all/both subexpressions are False.

New cards
23

When determining whether a number is inside a range, which logical operator is it best to use?

The AND operator

New cards
24

What is a flag and how does it work?

A Boolean variable that signals whether a certain condition exists in a program. It is typically set to True or False to indicate the status of a condition.

New cards
25

What is the Walrus operator?

A special symbol in Python that looks like this: :=. It's called the "walrus operator" because it kind of looks like the eyes and tusks of a walrus: :=

New cards
26

What does the Walrus operator do?

The walrus operator does two things at the same time:

Assigns a value to a variable (like giving a name to something).

Returns the value (so you can use it right away).

It's like saying, "Hey, give this thing a name, and let me use it right now!"

New cards
27

Control structure

New cards
robot