Software Design & Development: Unit 1 - Programming Paradigms Flashcards
What is a programming paradigm?
It is a specific style of programming (i.e. Imperative, Concurrent and Object Oriented)
What is Imperative Programming?
A type of language used to create programs consisting of a set of commands
What are the 3 basic control structures of Imperative Programming?
- Sequence
- Selection
- Iteration
What is the ‘sequence’ control structure in Imperative Programming?
When one command is executed followed by another in Imperative Programming
What is the ‘selection’ control structure in Imperative Programming?
If a condition is true then one command is executed, else if that condition is false then a different command is executed
What is the ‘iteration’ control structure in Imperative Programming?
A command is executed a set number of times
What are variables in Imperative Programming? (2)
- They are used to store values in a program, which can be changed.
- They are passed as parameters to procedures and functions
What is ‘modularity’ in Imperative Programming?
When commands are combines into a single block of self-contained code that can be used within a program to change values of parameters passed into them
What are the advantages of ‘modularity’ in Imperative Programming? (3)
- Modules can be treated as separate sub-programs which can be tested independently of the main program
- Large programming projects will benefit from a modular approach because several different people can work on different modules simultaneously
- Code will be more readable because the main part of a program can be presented as a concise set of commands, that call a procedure or function
What is Object-Oriented Programming?
A style of programming allowing a program to be separated into blocks of related data, and the operations which apply to that data.
What is an ‘object’ in OO programming?
A block of related data and the operations which apply to that data, where the data can only be accessed directly by its associated operations.
What is a ‘class’ in OO programming?
A class is a blueprint for an object, and when it is defined any number of objects can be created from that class.
What must be included in a ‘class definition’ in OO programming?(2)
- Instance Variables (or properties), which is what data the class needs to use
- Methods, which is what the class will be able to do with data
What is a ‘class library’ in OO programming?
A set of classes that can be used by developers as common building blocks for complex applications
Explain superclasses and subclasses in OO programming
The superclass establishes a common interface and foundation, which subclasses can inherit, modify, and append