• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/35

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

35 Cards in this Set

  • Front
  • Back

repetition structure

causes a statement or set of statements to repeat

another name for repetition structure is

a loop

condition-controlled loops

uses true/false conditions to control the number of times the loop repeats

the 3 different condition-controlled loops

while, do while, do until

pre-test loop

while loop executes its condition before performing another loop

posttest loop

do while, do until will execute conditions after a loop

infinite loop

repeats until something causes it to interrupt it due to not having a programmed condition to stop it

count- controlled loops

loops a specific number of times

decision structure

allows a program to perform actions only under certain conditions

If-then

single alternative decision structure

relational operators

>, <, >==, <==, ==, !=

Boolean expressions

expressions that are either true or false

dual alternative decision structure

has 2 paths of possible execution depending on whether the condition is true or false (if-then-else)

nested decision structure

a decision structure can be nested inside another decision structure

logical operators

AND, OR, NOT

AND

true when both statements are true

OR

true when either expression is true

NOT

reverses a statements logical value and returns false

Boolean variables

hold one of two values: true or false

How do count-controlled loops work

initialization, test, and increment

For loop

count- controlled


for counterVariable = startingValue TO maxValue


statement


statement


statemnet


End For

decrement

to decrease the value of the variable in a For loop

accumulator

keeps a running total

sentinel

special value that marks the end of a list of values

nested loop

loop in a loop

function

module that returns a value

library functions

pre-written functions in most programming languages



Random (1, 100)

generates a random number between 1-100

abs (n)

absolute value

sqrt (n)

square root

IPO chart

input, processing, output. helps with designing a program

garbage in, garbage out

the idea that if a program reads bad data as input, it will output bad data. programs should be designed to reject bad data

input validation

commonly done with a loop that iterates as long as an input variable contains bad data



process of input validation

get data, is input invalid, display error message, ask for data again,

defensive programming

practice of anticipating errors that can happen while a program is running and therefore designing the program to avoid those errors