Section 11 - Programming Techniques Flashcards
What is coding in sequence?
Coding line after line
What is coding in iteration?
Coding looping sections of code
What is coding in branching?
More than one possible code …
Subroutines and Recursion
What is recursion?
Calls itself until the base case is met
Use of an IDE
What are the features of an IDE (Integrated Dev Environment)?
- Prettyprinting
- Syntax checking
- Translators
- Runtime environment
- Debugging tools
process of converting/presenting source code in a legible/attractive way
Use of Object-Oriented Techniques
What is instantiation/initialisation?
Instantiation = Initialisation
Creation of an object
Use of Object-Oriented Techniques
What is polymorphism?
A method in a child class overwriting parent class methods
Use of Object-Oriented Techniques
What is encapsulation?
The use of different techniques (e.g. privating attributes) to ensure that data can only be accessed within a class
What is the difference between global variables and local variables?
Global variables can be accessed from anywhere in the program
Local variables can only be accessed within their module
Use of Object-Oriented Techniques
What is a class?
A template for the methods and attributes of an object
Use of Object-Oriented Techniques
What is an attribute?
A piece of data that an object has
Use of Object-Oriented Techniques
What is a method?
A subroutine in a class that defines the object’s behaviour
Subroutines and Recursion
What is the difference between passing a parameter by value and by reference?
By value
* actual value passed in
* treated as local variable - original will not be affected
By reference
* address of the parameter passed in
* treated as global variable - original will be affected