Frage | Antworten |
What is a function? | A function is a construct you can use to combine local variables and statements to perform a single task Self-contained segment of code that accomplishes a specific task. Can be called multiple times. Reduces repetitive lines of code |
What is the function scope? | Each function only knows about its own data. (local variables) |
3 Categories of functions | Input, Output, processing |
What is function recursion? indirect recursion? | recursion - a function should not call itself indirect recursion - function calling back to a function that called it. |
What is a decision? | In algorithm design (and programming) all decision are done with comparisons All the standard mathematical comparisons are available to us: Equal (=) Less than (<) Greater than (>) |
Boolean? | “Boolean” value (variable type) Is either “True” or “False” (“Yes” or “No”, 0 or 1) ALL decisions MUST be “boolean” The result of a decision MUST be “True” or “False” “Yes” or “No” |
3 types of decisions | Single path decision Two possible paths Many paths |
What is used to plan our decisions? | Condition/Action tables |
What are iterations | the repetition of a process |
3 parts of a loop | Loop variable - what value are we checking loop body - what happens in the loop exit condition - when do we stop |
What is a sentinel value? | is a special value in the context of an algorithm which uses its presence as a condition of termination. |
Boolean Algebra | Allows us to combine boolean values to produce new boolean values |
Boolean operators | AND, OR, NOT |
What is an array? | An “array’ is a whole list (or collection) of data Accessed by a single variable name |
Möchten Sie mit GoConqr kostenlos Ihre eigenen Karteikarten erstellen? Mehr erfahren.