2.2 Problem solving and programming Flashcards

1
Q

What is branching

A

A programming control structure where the code selects one or more alternative paths depending on the evaluation of a Boolean expression

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

What are functions

A

A subroutine that can be called to perform a task or calculation and will always return a value

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

What are global variables

A

A variable declared in the main program which exists outside any of the subroutines but can be used anywhere in the program

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

Integrated development environment

A

A software package the allows a user to develop and implement code more easily with features for editing, debugging, version control, testing and compilation

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

Iterations

A

A programming control structure where as set of statements is repeated either a fixed number of times or until a condition is met

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

Local variables

A

A variable declared within a subroutine of a program which only exists and can be used within that subroutine

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

Modularity

A

Breaking down a complex problem into simpler, self-contained components called modules

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

What is each module

A

An implementation of a specific subtask required to solve a problem

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

What is object oriented programming

A

Pp Where the system is viewed as a set of objects with their own attributes and procedures that can interact with each other

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

What is all processing done by in OOP

A

Objects

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

Passing by reference

A

Passing the address or pointer of the required value into a procedureP

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

Passing by value

A

Creating a temporary local copy of the actual value of a variable and passing it into the procedure

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

Parameters

A

The data structures required to be passed into a subroutine

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

Procedures

A

A subroutine that is called by simply writing its name in the code. Procedures do not have to return a value in the program

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

What is recursion

A

A programming subroutine where a section of code calls itself until a base case is met. The base case must be chosen to avoid any possibility of an infinite loop

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

What are sequences

A

A programming control structure in which statements are executed one after another as they appear in the script

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

Subroutines

A

A uniquely named section of code that is written to perform a specific task within a program

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

What is backtracking

A

An algorithms that incrementally finds a solution by methodically trying different sequences and abandoning a path when it knows it cannot lead to a valid solution

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

Computable problems

A

A problem for which every instance can be solved in a finite number of steps by means of an algorithm

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

Computational methods

A

A method of solving a problem which by some form of computation in devising and implementing an algorithm

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

Data mining

A

An algorithms that finds a solution by analysing a large data set to uncover trends and relationships between variables

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

What is divide and conquer

A

An algorithm design technique to decompose and solve problems by reducing the problem size with each iteration until the sub problem becomes solvable

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

Heuristics

A

A rule of thumb algorithm which can produce a valid albeit sub-optimal solution for a hard (intractable) problem as an approximation

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

Performance modelling

A

The process of simulating the behaviour of a model under different virtual user and system loads by mathematical approximation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is pipelining
The process of splitting a task into parts and then searching for subtasks that can be processed simultaneously to overlap the processing of each part
26
What is problem decomposition
The process of splitting a given problem into smaller, solvable sub-problems that are easier to conceive, understand, maintain and program
27
What is problem recognition
The ability to recognise the most effective strategy to solve a problem
28
What is visualisation
The use of a visual representation of an algorithms or data structure to translate a problem and it's solution to a more human readable form
29
What is sequence
Code is executed line-by-line, from top to bottom
30
What is branching
A certain block of code is run if a specific condition is met, using IF statements. This is also known as ‘selection’
31
What is iteration
A block of code is executed a certain number of times or while a condition is met. Iteration uses FOR, WHILE or REPEAT UNTIL loops. Iteration can be eitherT
32
Two types of iteration
Count controlled and condition controlled
33
What is recursion
subroutine calls itself during its execution. This continues until a certain condition - called the stopping condition - is me
34
Advantage of recursion
Sometimes fewer lines of code are needed
35
What is the stopping conditions called in recursion
Base case
36
What should the stopping condition be reachable within
A finite number of times
37
What does a modular design also make it easier to do
Divide tasks between a team and manage whilst simplifying the process of testing and maintenance as each component can be dealt with individually
38
What does modular programming improve
The reusability of components
39
Example of stepwise refinement (top down approach)
40
Should you assume by ref or by val?
Assume they are passed by value
41
What does and IDE do in simple terms
Make it easier for programmers to write, develop and debug code
42
What are some examples of IDE's
PyCharm, Eclipse, IDLE and Microsoft Visual Studio
43
What is stepping (IDE)
This allows you to monitor the effect of each individual line of code by executing a single line at a time
44
What is variable watch (IDE)
Sometimes used to pinpoint errors, this is a useful feature to observe how the contents of a variable change in real-time through the execution of a program.
45
What is breakpoint (IDE)
Sometimes used to pinpoint errors, this is a useful feature to observe how the contents of a variable change in real-time through the execution of a program.
46
What is source code editor (IDE)
The editor aims to make the coding process easier by providing features such as autocompletion of words, indentation, syntax highlighting and automatic bracket completion.
47
What are debugging tools (IDE)
Some IDEs also provide run-time detection of errors with a guide as to where in the code they are likely to have occurred through line numbers and highlighting
48
What is a class
A template for an object and defines the state and behaviour of an object.
49
What is state
Given by the attributes which give an objects properties
50
What is behaviour
Defined by the methods associated with a class which describe the actions it can perform
51
What is the process that creates objects using classes
Instantiation
52
What is an object in relation to a class
A particular instance of a class
53
Are attributes public or private
Private so can only be altered by public methods
54
What is it called when attributes are made private
Encapsulation
55
What does encapsulation Implement
The principle of information hiding and makes programs simpler by protecting data being accidentally edited
56
How does top down design implement encapsulation
Makes each module designed to be self contained
57
What makes a program computable (solvable using an algorithm)
Problems can only be called computable if they can be solved within a finite, realistic amount of time
58
Problem recognition
Stakeholders state what they require from the finished product and this information is used to clearly define the problem and the system
59
What are the requirements defined by
Analysing strengths and weaknesses with the current way this problem is being solved ● Considering types of data involved including inputs, outputs, stored data and amount of data
60
What else does problem decomposition allow
The project to be developed in parralel
61
What is divide and conquer
r is a problem-solving technique used widely across computer science. This strategy can be broken down into three parts: divide, conquer and merge
62
Example of divide and conquer
Binary search
63
Biggest advantage of divide and conquer
size of the problem is halved with each iteration which greatly simplifies very complex problems. This means that as the size of a problem grows, the time taken to solve it will not grow as significantly
64
What is a stack ovrerflow
when a computer program tries to use more memory space in the call stack than has been allocated to that stack.
65
Representational abstraction
Excessive details removed
66
Abstraction by generalisation
Grouping together section of problem with similar functionality allow code to be re used
67
Backtracking
y methodically visiting each path and building a solution based on the paths found to be correct. If a path is found to be invalid at any point, the algorithm backtracks to the previous stage and visits an alternate path
68
Example of backtracking
Depth-first graph traversals
69
What is data mining
Data mining is used in software designed to spot trends or identify correlations between data which are not immediately obvious (looking for patterns)
70
What can insights from data mining be used to make
Data mining is used in software designed to spot trends or identify correlations between data which are not immediately obvious
71
Crucial thing with data mining
, as data mining often involves the handling of personal data, it is crucial that it is dealt with in accordance with the present legislation regarding data protection
72
Heuristics
Non optimal approach to problem solving to find an approximate solution when standard solution is time consuming or resource intensive
73
Example of heuristics
A* algorithm
74
Performance modelling
Performance modelling eliminates the need for true performance testing by providing mathematical methods to test a variety of loads on different operating systems.
75
Advantages of performance modelling
cheaper, less time-consuming or safer method of testing applications
76
Use of performance modelling
This is useful for safety-critical computer systems, such as those used on an airplane, where it is not safe to do a real trial run before the system can be implemented
77
Pieplining
faster, as modules are divided into individual tasks, with different tasks being developed in parallel
78
What is a production line
Traditionally, the output of one process in pipelining becomes the input of another, resembling a production line.
79
Visualisation
Data can be presented in a way that is easier for us to understand using visualisation. This makes it possible to identify trends that were not otherwise obvious, particularly amongst statistical data
80
What is polymorphism
Polymorphism is a concept in programming that allows objects to take on different forms or behaviours.
81