1.2 Software and software development Part 2 Flashcards

1
Q

1.2.4 (a) Paradigm

A

To describe an example of a way of doing things
E.g. Functions, Variable, Loops
Turing Complete: Can solve all problems that a computer is able to solve
Some problems are better suited to being solved using a certain paradigm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

1.2.4 (a) Low Level Languages

A

Machine Code
Assembly Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

1.2.4 (a) Machine Code

A

Least abstracted, closest to what actually happens on a computer
Programs are in ones and zeros
Match high (1) and low (0) electric signals

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

1.2.4 (a) Assembly Language

A

Uses code words (mnemonics)
Mnemonics match specific sequences of machine ones and zeros
In a one - to - one relationship
Translated by an assembler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

1.2.4 (a) High Level Languages

A

First one was Fortran
One to many relationship
Each line of code is many lines of machine code
Imperative: Statements that change a program’s state through sequence, selection and iteration
Consists of commands for a computer describing how a program operates
Declarative: Focus on what the program should accomplish

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

1.2.4 (a) Imperative Languages

A

High Level Languages
Procedural Programming: Program is built from one or many sub-routines
Object-Oriented Programming: Focus on a modular approach to programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

1.2.4 (a) Advantages of Low-Level Code

A

Both as efficient as each other (1 - to - 1 relationship)
Produce precise optimised and efficient code
Provides direct access to system features without a software interface, improving speed
Complete control over code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

1.2.4 (a) Disadvantages of Low-Level Code

A

Machine dependant, not portable
Difficult to write efficient assembly code
Tedious and Prone to bugs when writing code
Difficult to understand modify and maintain

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

1.2.4 (a) Procedural: Features, Data, Structure

A

Features: Sequence, Selection, Iteration
Data: Local / Global Variables, Parameter Passing
Structure: Procedures, Functions, Procedure Calls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

1.2.4 (a) OOP: Features, Data, Structure

A

Features: Sequence, Selection, Iteration, Inheritance, Objects, Classes, Encapsulation
Data: Attributes concealed via encapsulation
Structure: Classes, Methods, Instances, Based on Models or Behaviours

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

1.2.4 (b) Procedural Languages

A

Tell a computer what to do through step-by-step instructions
Use sequence, selection, iteration
Code is developed using modules
Blocks of code identify tasks that need to be completed - Use Procedures and Functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

1.2.4 (c) Assembly Languages

A

First languages were machine code e.g. ENIAC
Assembly Languages are easier to program with
Substitutes binary code with mnemonics
Directly translated by an assemblers
Use Little Man Computer With 11 Mnemonics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

1.2.4 (c) Little Man Mnemonics

A

1(Opcode) ADD: Add
2 SUB: Subtract
3 STA/STO: Store
5 LDA: Load
6 BRA: Branch Always
7 BRZ: Branch if zero
8 BRP: Branch if positive
9 INP: Input
9 OUT: Output
0 HLT: Halt Program
DAT: Data Location
4 : Returns an Error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

1.2.4 (c) Little Man Computer Structure

A

Label Mnemonic Physical Data
Num1 DAT
ADD Num1

Labels Indicate Location
Mnemonics Represent Instruction (1st bit of data)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

1.2.4 (c) Little Man Computer Execution

A

Follows the FDE cycle
The PC increments each time
Instructions are loaded into RAM locations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

1.2.4 (d) Addressing Modes

A

Immediate
Direct
Indirect
Indexed

17
Q

1.2.4 (d) Immediate Addressing (Immediate Operand)

A

The value in the operand is the value to be used
The memory does not need to be searched to find the required value

18
Q

1.2.4 (d) Direct Addressing

A

The value in the operand is a reference to the address in memory where the required value is located

19
Q

1.2.4 (d) Indirect Addressing

A

The value in the address part of the instruction (operand) is a reference to a memory location that contains the address in memory where the required value is located
Means larger address ranges can be used to reference data and instructions
Larger memory addresses can be accessed

20
Q

1.2.4 (d) Indexed Addressing

A

Index Register is set to 0
First value is taken from the operand + 0
Index register is incremented by one
Same instruction is used again with the operand + 1
Address of element 0 in the operand increments
must be stored in contiguous memory locations

21
Q

1.2.4 (e) OOP

A

Object Oriented Programming
Captures / Groups information, data and functionality into structured items know as objects
Using OOP, the world is viewed as a collections of objects
Objects are responsible for their own data and the operations preformed on that data
Objects send and receive messages to interact

22
Q

1.2.4 (e) Methods and Attributes

A

When objects are put into classes
They have a class name
They contain Attributes (Variables) - All the information shared by any object of the class
And Methods (Subroutines) - Code associated with the class that allows you to access or change it’s attributes

23
Q

1.2.4 (e) Classes

A

A template to make all objects of a class, look the same
An object is an instance of a class
Class can be re-used for multiple objects of the same class
Creating an instance of a class using the keyword new

24
Q

1.2.4 (e) Instantiation

A

The process of creating an object from a class template
Object exist in memory with a copy of attributes and methods from the class template
Use the dot (.) Notation to call different methods of that particular object

25
1.2.4 (e) Keyword New
Constructor Method Runs when an object of that class type is created Sets the attributes to the parameter values
26
1.2.4 (e) Inheritance
We can reuse the code from the Person class and extend it's attributes and methods without affecting the original code We can create a new class that inherits from another class and add methods and attributes Split into superclass and sub/derived class If we create further subclasses, then they inherit all the methods and attributes from all higher classes
27
1.2.4 (e) Method Overriding
We can use a method with the same name in a sub-class, to contain more specific code, relevant to that class - The method is overridden Overriding occurs automatically when you call a method from an object that shares the same name as a method further up the class tree The overriding method takes precedence and replaces the method from the superclass By using Object.super.method, we can use the method from the superclass without overriding
28
1.2.4 (e) Encapsulation
The budling of data with the methods that operate on and restrict direct access to it Used to hide the values or internal state of an object, preventing direct access by unauthorised parties Encapsulated attributes of an object should only be changeable by the object's methods Encapsulation helps keep the data safe, as it cannot be altered by another part of the program, without using the methods, keeping the programmer in control Attempts to directly access an object's attributes cause an error Methods must be supplied to alter attributes Methods are public - Can be accessed, Attributes are private - Only altered by methods of the same object
29
1.2.4 (e) Polymorphism
Something that occurs in several different forms Static or dynamic Symbols e.g. + takes on different forms e.g. arithmetic or concatenator depending on the context
30
1.2.4 (e) Dynamic Polymorphism
Giving an action one name that is shared up and down an object hierarchy, with each object in the hierarchy implementing the action in an appropriate way to itself