chapter 4: conditionals and recursion

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/16

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

17 Terms

1
New cards

%

modulus: calculates the remainder

2
New cards

==

equals

3
New cards

!=

Not equal

4
New cards

>=

Greater than or equal to

5
New cards

<=

Less than or equal to

6
New cards

Both sides of a conditional operator have to be _______.

The same type

7
New cards
8
New cards

= vs. ==

Assignment operator vs. conditional operator

9
New cards

Sequence of “if” statements

Program will go through executing each conditional

10
New cards

if : else : else if sequence

Program will stop executing as soon as the first condition is met.

11
New cards

What happens when an argument reaches zero?

Function returns immediately

12
New cards

Conditional

A block of statements that are executed only depending on the truth of the statements.

13
New cards

Chaining

A way of joining conditional statements in sequence.

14
New cards

Nesting

Putting a conditional statement inside one or both branches of another conditional statement.

15
New cards

Recursion

The process of calling the same function you are executing.

16
New cards

Infinite recursion

A function that will call itself without ever reaching the base case. The sequence will theoretically continue forever but it will eventually result in a run-time error in actuality.

17
New cards