Y12 Revision
Software Lifecycle
What is a programming paradigm?
- It is the style of programming you can write.
- Whether you have a paradigm that sets out the rules that exist and can be searched through (declarative programming)
- You could have one that neatly sets the program out into different sections (functional programming)
- Or one that sets up defining functions (classes) that allows you to create objects, inheriting different methods from that class (object-oriented programming)
4 Different Programming Paradigms
-
Procedural programming
- Supported by Python, Basic, Pascal and C#
-
Object-oriented programming
- Supported by Java, C++, Visual Basic.net and Python
-
Declarative programming
- Supported by SQL and Prolog
-
Functional programming
- Supported by Haskell, JavaScript, Logo and Python
The only one Python doesn't support is Declarative programming
Imperative Programming
- Imperative programming is of a series of instructions that tell the computer what to do with an input in order to solve the problem
-
Procedural programming is imperative programming with procedure calls
Structured Programming
-
It is a kind of procedural (imperative) programming which uses the constructs sequence, selection, iteration and recursion rather than “goto” statements
-
Modular techniques are used to split a large program into manageable chunks
Logic Programming
-
Logic programming is a form of
declarative programming -
It is a paradigm that expresses the logic of a computation without expressing its control flow
-
Programs consist of logical statements
-
An example would be Prolog
Object-Oriented Programming (Key Words)
- Class
- Object
- Inheritance
- Encapsulation
- Polymorphism
Object-Oriented Programming (Key Words)
A class is a blueprint for an object defining the attributes and methods that define the 'common characteristics' of that class.
E.g. A cat has 4 legs and eats.
An object is a 'thing' in your program, such as a person, vehicle, animal or event.
Inheritance is the action of an object obtaining methods and attributes from a class. But those object may also have their own methods and attributes.
Object-Oriented Programming (Key Words)
Encapsulation means to hide all the attributes and methods within one unit, such as a class. So users cannot access the attributes or methods.
Polymorphism is the object having methods or attributes that the parent class does not have, or even redefining them to mean something else.
E.g., A bird may have an attribute eat, but a parrot would take this as eating seeds whereas a chick would take this as eating meat and seeds.
Lifecycle Models
Waterfall Lifecycle
•Each stage is completed
and documented before the next is begun
•The customer does not see the end product until it is completed
•Any change to be made often means the project has to be started again
Agile Model
•Software is developed in rapid incremental cycles
•Each version builds on previous functionality
•Each version is thoroughly tested before release
•Good for small, time-critical projects
•Limited planning is needed to get started
Extreme Programming
•Extreme programming is a type of agile software development
•Frequent releases of the software are made in short development cycles
•It is intended to improve productivity and responsiveness to changing customer requirements
Spiral Model
•The four basic steps of analysis, design, implementation (i.e. programming and testing) and evaluation are followed
•Each successive loop round the spiral generates a new, more refined prototype until the software meets all the requirements
Rapid Application Development
•Workshops and focus groups gather requirements rather than using a formal document
•Prototyping is used to continually refine the system in response to user feedback
•Each part of the system is produced within a strict time limit – maybe not perfect, but good enough
•Software components are reused whenever possible
Sorting Algorithms
Bubble Sort
•Starting with the first item in the list, each item is compared with the adjacent item and swapped if it
is larger
•At the end of the first pass, the largest item ‘bubbles’ up to the end of the list
Challenge: Can you create a pseudocode for a bubble sort algorithm?
Searching Algorithms
•Two of the most common searching algorithms are the linear search and the binary search
•The linear search starts at the beginning of the list and examines every item
•The binary search uses the “divide and conquer” strategy to halve the search area each time an item is examined
•A binary search can only be used if the items are in sorted order – they could be alphabetic or numeric, for example
________ Search Algorithm
What sort of searching algorithm is this?
Assembly Language
Mnemonics
Mnemonics
What does this machine language code do?
Y12 Revision
By CJackson
Y12 Revision
- 234