CSA 2.6-2.11 Vocab

0.0(0)
studied byStudied by 2 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/14

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

15 Terms

1
New cards

De Morgan's Law

Can be applied to Boolean expressions to create equivalent ones:

!(a && b) is equivalent to !a || !b

!(a || b) is equivalent to !a && !b

2
New cards

Negation

A negated expression with a relational operator can be simplified by flipping the relational operator to its opposite sign.

!(c == d) is equivalent to c != d

!(c != d) is equivalent to c == d

!(c < d) is equivalent to c >= d

!(c > d) is equivalent to c <= d

!(c <= d) is equivalent to c > d

!(c >= d) is equivalent to c < d

3
New cards

Aliases

When two object references reference the same object

4
New cards

While Loop

A type of iterative statement. The Boolean expression is evaluated before each iteration of the loop body, including the first. When the expression evaluates to true, the loop body is executed. This continues until the Boolean expression evaluates to false, whereupon the iteration terminates.

5
New cards

Loop Control Variable

Used in the boolean condition of the loop

6
New cards

Infinite Loop

occurs when the Boolean expression in an iterative statement always evaluates to true

7
New cards

Off by One Error

occur when the iteration statement loops one time too many or one time too few

8
New cards

Input Controlled Loops

Use a sentinel value that is input by the user like “bye” or -1 as the condition for the loop to stop

9
New cards

For Loop

Type of iterative statement. There are three parts: the initialization (of the loop control variable or counter), the Boolean expression (testing the loop variable), and the update (to change the loop variable).

10
New cards

Accumulator Pattern

An algorithm that involves storing and updating an accumulator value within a loop, for example to compute a sum or average of a set of values.

11
New cards

int length()

returns the number of characters in a String object

12
New cards

int indexOf(String str)

returns the index of the first occurrence of str or -1 if str is not found

13
New cards

String substring(int from, int to)

returns the substring beginning at index from and ending at index (to – 1). Note that s.substring(i,i+1) returns the character at index i

14
New cards

String substring(int from)

returns substring(from, length())

15
New cards

Nested Iteration Statements

Iteration statements that appear in the body of another iteration statement. When a loop is nested inside another loop, the inner loop must complete all its iterations before the outer loop can continue.