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.
What is a local variable?
A variable that can only be modified within a module or subroutine.It only contains values when the subroutine is accessed.I cannot be affected by other bits. However it heavily depends on memory locations.
What is a function?
Algorithm that takes an input and produces an output for each input.
Sequence of Function Events?
Line of function code comes up
Control is passed to function and instructions within it are executed
Control passes back to line calling function.
Any data from function is used in code instead of function
What do we require to define a function?
A function name,parameters and process code.
What is a difference between a procedure and function?
Function always has an output a procedure can have control signals.
How can we pass parameters?
By Reference - pass the address of memory location where parameter is stored
By Value - passing value of actual parameter
What does IDE stand for ?
Integrated Developement Enviroment
What is an IDE?
a software application providing facilities for programmers for development
What does an IDE provide?
availability to edit source code facility for program building version control debugging tool testing tool compilation tool