CT and Programming Flashcards
What is the shape for a
start or end of the program
in a flowchart?
an oval
What is the shape for a
process
in a flowchart?
a rectangle
What is the shape for a
decision
in a flowchart?
a diamond
What is the shape for an
input or output
in a flowchart?
a parallelogram
What is the shape for a
subprogram
in a flowchart?
a rectangle with two rectangles either side
What is a
constant?
a memory location that holds a value that does not change when the program is run
Define
sequencing.
completing instructions in order, one after another
Define
selection.
choosing a path of instructions to follow based on a Boolean condition
What is
decomposition?
usually the first step in the problem-solving process, where the problem is broken down into smaller, more manageable parts which are then easier to solve
What are the positives of
decomposition?
(and subprograms in general) (3)
- sub-problems can be worked on by different teams at the same time
- it is easier to spot and correct errors
- code can be reused
What is
abstraction?
the removal of unecessary detail in a problem
Define
data structure.
an organised collection of related elements
What does an
array do?
and give an example.
store data items all of the same data type
e.g.
[“Alice”, “Barry”, “Catherine”]
[75, 82, 45, 55]
What does a
record do?
and give an example.
stores a set of related elements of different data types
e.g.
[384, “Collins”, “Ivy”, 2010, 15.34]
What is a
field?
each element in a record
What are the
similarities and differences of iteration and repetition?
(1 of each)
+iteration and repetition both repeat a section of an algorithm
-iteration repeats for every item in a data structure whereas repetition repeats either a fixed number of time, or until a condition is met
What are some examples of
input validation?
(4)
- range check
- length check
- presence check
- pattern check
What are the
three broad categories of errors?
- syntax errors
- run-time errors
- logic errors
What is a
syntax error?
and what are some examples?
an error that breaks the rules of the grammar of the language
e.g. misspelled keywords, missing or excessive indentation
the computer cannot translate the code into machine code, and so cannot run it
What is a
run-time error?
and what are some examples?
an error that causes a program to crash because it cannot execute one of the instructions in the code
e.g. divide by zero, index out of range
What is a
logic error?
and what are some examples?
an error that causes incorrect or unwanted behaviours
e.g. wrong arithmetic operator or mixing up two variable names