Problem Solving Flashcards
What is a sequence?
Execution of statements or functions one after another.
What is selection?
Where the program is interrupted and moved onto a different point based on a decision. This is normally a Boolean expression.
What is iteration?
Controlled by Boolean expression, a section of the code that is repeated.
What are examples of iteration?
For
While
Repeat
What is repeat?
The section of code is repeated until the condition is fulfilled. A repeat is always executed at least once.
What is a while loop?
Condition for maintaining or terminating is checked before entry on to the loop. A while loop may or may not be executed at all.
What is a for loop?
Loop executes a fixed number of times, controlled by a variable.
What is Recursion?
Is where a procedure or function calls itself.
What is a global variable?
Is declared or initialized outside any subprograms; that is functions or procedures. It then becomes accessible to code written anywhere in the program. This can be useful if the programmer needs to be able to update a value from various subprograms, perhaps a running total of the results.
What is a local variable?
Is declared inside a subprogram. This results in it only being accessible within that subprogram.
Why is it good to use local variable?
Because they are less likely to accidentally be altered by other modules.
What is a function?
A function is an algorithm that take an input and produces an output for each input. Some function have multiple inputs and outputs.
What are procedures?
Are subprograms that help and support modular programming. The only real difference between a procedure and a function is that a function should return a value. Procedures are generally a set of commands that act independently of the rest of the program and do not usually return a value.
What is an IDE.
Integrated Development Environment: Specially designed software package that includes an editor for writing source code, facilities for automating the build, a debugger and features to help with code writing.