2c Flashcards

1
Q

Define abstraction

A

Process of removing excessive details to arrive at a representation of a problem that consists of only the key features. Often involves analysing what is relevant to a given scenario and simplifying a problem based on this information (representational abstraction)

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

What is abstraction by generalisation

A

Process of removing excessive details to arrive at a representation of a problem that consists of only the key features. Often involves analysing what is relevant to a given scenario and simplifying a problem based on this information (representational abstraction)

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

Define data abstraction

A

Details about how data is being stored are hidden. E.g stacks and queues

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

What is the need of abstraction

A

Allows non experts to make use of a range of systems or models by hiding information that is too complex or irrelevant to the systems purpose
Enables more efficient software design
Reduces time spent on projects
Prevents unnecessarily large program

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

Define thinking ahead

A

Thinking about the different components of a problem and how to handle them in the best way possible
Means designing strategies for programs is easier and intuitive to use

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

Define preconditions

A

Requirements which must be met before a program can be executed
Specifying preconditions means subroutine can safely expect the arguments passed to certain criteria
Reduces length and complexity of code
Saves time needed to debug and maintain a longer program
Makes subroutines more reusable

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

What are libraries

A

Contain commonly used functions for reuse, including queues, stacks, classes and subroutines

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

Define decomposition

A

Breaking down a complex problem or system into smaller parts that are more manageable and easier to understand.

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

What are the advantages of reusable components

A

More reliable
Already been tested
Saves money, time and resources
Can be reused in future projects (- compatibility issues)

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

Define thinking procedurally

A

Large complex problem is continually broken down into smaller subproblems.
Makes project easier to manage and can be divided between a group of people

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

Define paradigm

A

The approach used when developing a piece of software

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

Define sequence

A

Code is executed line by line from top to bottom

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

Define branching

A

Particular block of code is run if a specific condition is met

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

Define iteration

A

Count controlled (block of code executed certain number of times)
Condition controlled (block of code is executed while a condition is met)

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

Define scope

A

Section of code in which the variable can be accessed

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

Define local variable

A

Can only be accessed within the subroutine in which they were defined
Deleted once subroutine ends
Ensure subroutines are self contained

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

Define global variables

A

Accessed across the whole program
Danger of being unintentionally edited
Not deleted until program terminates, requires more memory

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

Define modular programming

A

Technique used to split large, complex programs into smaller, self contained modules
Easier to divide tasks between a team
Each component can be dealt with individually
Improves reusability

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

Examples of modularity

A

Breaking down problem into sub problems
Functions and procedures
Passing by value
Giving address of parameter to subroutine

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

Define IDE

A

Program that provides a set of tools to make it easier for programmers to write, develop and debug code

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

List features of IDE

A

Stepping
Variable watch
Breakpoint
Source code editor
Debugging tools

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

List stages in the software development cycle (SDLC)

A

Analysis
Design
Development
Testing
Implementation
Evaluation
Maintenance

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

Explain waterfall lice cycle

A

Stages are completed in sequence
Clear structure
To make change all stages must be revisited
Low user involvement
Lack flexibility
No risk analysis

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

Explain agile methodologies

A

Aim to improve flexibility
Adapt quickly to user requirements
Different sections developed in parallel
Working prototype delivered early on
Less focus on documentation
High user satisfaction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Explain extreme programming
Example of agile model High quality and highly usable software Programmers work no more than 40hrs per week Hard to produce high quality documentation
26
Explain spiral model
Manages high risk projects Four stages: Analysing requirements Pinpointing and mitigating risks Development, testing and implementation Evaluating to inform the next iteration of Project terminated if too risky Specialist risk accessor hired Lack of focus on code efficiency
27
Define RAD
Iterative methodology User requirements gathered using focus group Incomplete version given to user by trial User feedback used to generate improved prototype Final prototype matches user requirements fully Used when user requirements are incomplete or unclear Code may be inefficient Fast pace Late changes may reduce code quality
28
Define algorithm
Set of instructions used to solve a problem
29
Qualities of a good algorithm
Clearly defined inputs Valid output for defined input Able to deal with invalid inputs Must always reach a stopping condition Well do documented Well commented
30
Define alpha testing
Carried out in house by software development teams Bugs are pinpointed and fixes
31
Define beta testing
Carried out by end users Feedback from users informs next stage of development
32
Define white box testing
Carried out by software development teams Internal structure of program is recognised All possible routes through program are tested
33
Define black box testing
Testers are not aware of internal structure of the software Test plan traces through inputs and outputs
34
Purpose of a trace table
Records when and which variables are updated
35
Explain time complexity
Time taken to solve particular problem Measured with bi-o notation to show effectiveness
36
Notation for constant time complexity
0(1) Time taken for algorithm independent from number of elements inputted
37
Notation for linear time complexity
0(n) Time taken is directly proportional to the number of elements inputted
38
Define space complexity
Amount of storage an algorithm takes
39
Define algorithm
Series of steps that complete a task
40
How to reduce space complexity on an algorithm
Perform all of the changes on the original pieces of data
41
How to reduce time complexity on an algorithm
Reduce the number of embedded for loops as possible
42
Explain a linear search algorithm
Traverses through every item one at a time until it finds the item it is earthing for
43
Explain binary search algorithm
Divides and conquers Only applied on sorted data
44
Explain bubble sort algorithm
Passes through the list evaluating pairs of items and ensuring the larger value is above the smaller value
45
Explain what a stack is
First in last out data structure
46
How to check size of stack
size()
47
How to check if stack is empty
isEmpty()
48
How to return top element of stack
peek()
49
How to add to stack
push(element)
50
How to remove top element from stack and return removed element
pop()
51
Explain what a queue is
First in first out data structure Front holds position of first element Back stores next available space
52
How to check size of queue
size()
53
How to check if queue is empty
isEmpty()
54
How to return top element of queue
peek()
55
How to add to queue
enqueue(element)
56
How to remove element at the front of the queue and return it
dequeue()
57
How does bubble sort work?
Makes comparisons and swaps between pairs of adjacent elements
58
How does insertion sort work?
Inserts elements into the correct position
59
What is the pseudocode for a linear search algorithm
Function linearsearch (search,data[]) Position=-1 For i = 0 to data.length-1 If data [i] == search then Position=i Break Endif Endfor Return position End function
60
What is the pseudocode for binary search algorithm
Function binary search (search,data[]) Position= -1 Lower=0 Upper= data.length-1 While lower < = upper Mid=(lower+upper) DIV2 If data [mid]== search then Position=mid Elseif data [mid]< search Lower=mid+1 Else Upper=mid-1 Endif End while Return position End function
61
Write bubble sort algorithm
Procedure BubbleSort (data[]) Swapped=True While swapped == True: Swapped = false: For n=0 to data.length-2: If data [n]>data[n+1]: Temp=data[n+1] Data [ n+1]=data[n] Data[n]=temp Swapped=True End if Endfor End while End procedure
62
What is the insertion sort algorithm
Procedure InsertionSort(data[]) For i = 1 to data.length -1 Current data = data[1] Position=i While (position >0 AND data[position-1]> current data) Data[position]=data[position-1] Position= position-1 End while Data [position ]= current data End for End procedure
63