2.2.1 Programming Techniques Flashcards
What is a statement?
Single instruction or step in a program
What is a procedure?
Subroutine that sends control signals
What is a subroutine?
Set of instructions performing a specific task as a part of a larger system
What is a parameter?
Data given to a function or a procedure.
What is a function?
subroutine that executes statements and returns a single value
What is a sequence ?
A structure of statements/instructions that are executed in written order.
What is selection?
Something that allows us to select statements which will be executed depending on the conditions.
What is iteration?
Something that allows us to execute a block of statements multiple times.
Types of Iteration?
CONDITION_CONTROLLED - does the instruction have to be executed ?
REPEAT UNTIL - Tests whether a loop needs to be executed again.
INFINITE LOOPS - forever loop usually caused by an error.
COUNT - CONTROLLED LOOP - Using a variable to determine whether an instruction has to be repeated
What is nesting ?
Using more than one type of constructs.
What are the 2 good programming standarts.
Indentation - putting code into blocks
Naming Forms - naming varuiables and constants in a certain way so that is improves readibility
What are variables used for?
To store data items and allow them to be changed.A location in memory holding values.
What are arrays?
Many memory locations used to store multiple pieces of data, a dataset.
What are the two scopes of variables?
LOCAL
GLOBAL
What is a global variable ?
A variable that cann be read and modified by any bit of code. It makes it easier to pass values, making more efficient use of memory.However it increases the risk of the value being changed into something wrong, which would be hard to find.