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
Q

What is pipelining

A

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

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

What is problem decomposition

A

The process of splitting a given problem into smaller, solvable sub-problems that are easier to conceive, understand, maintain and program

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

What is problem recognition

A

The ability to recognise the most effective strategy to solve a problem

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

What is visualisation

A

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

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

What is 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
30
Q

What is branching

A

A certain block of code is run if a specific condition is met, using IF
statements. This is also known as ‘selection’

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

What is iteration

A

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

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

Two types of iteration

A

Count controlled and condition controlled

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

What is recursion

A

subroutine
calls itself during its execution. This continues until a certain
condition - called the stopping condition - is me

34
Q

Advantage of recursion

A

Sometimes fewer lines of code are needed

35
Q

What is the stopping conditions called in recursion

A

Base case

36
Q

What should the stopping condition be reachable within

A

A finite number of times

37
Q

What does a modular design also make it easier to do

A

Divide tasks between a team and manage whilst simplifying the process of testing and maintenance as each component can be dealt with individually

38
Q

What does modular programming improve

A

The reusability of components

39
Q

Example of stepwise refinement (top down approach)

A
40
Q

Should you assume by ref or by val?

A

Assume they are passed by value

41
Q

What does and IDE do in simple terms

A

Make it easier for programmers to write, develop and debug code

42
Q

What are some examples of IDE’s

A

PyCharm, Eclipse, IDLE and Microsoft Visual Studio

43
Q

What is stepping (IDE)

A

This allows you to monitor the effect of each individual line of code by
executing a single line at a time

44
Q

What is variable watch (IDE)

A

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
Q

What is breakpoint (IDE)

A

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
Q

What is source code editor (IDE)

A

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
Q

What are debugging tools (IDE)

A

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
Q

What is a class

A

A template for an object and defines the state and behaviour of an object.

49
Q

What is state

A

Given by the attributes which give an objects properties

50
Q

What is behaviour

A

Defined by the methods associated with a class which describe the actions it can perform

51
Q

What is the process that creates objects using classes

A

Instantiation

52
Q

What is an object in relation to a class

A

A particular instance of a class

53
Q

Are attributes public or private

A

Private so can only be altered by public methods

54
Q

What is it called when attributes are made private

A

Encapsulation

55
Q

What does encapsulation Implement

A

The principle of information hiding and makes programs simpler by protecting data being accidentally edited

56
Q

How does top down design implement encapsulation

A

Makes each module designed to be self contained

57
Q

What makes a program computable (solvable using an algorithm)

A

Problems can only be called
computable if they can be solved within a finite, realistic amount of time

58
Q

Problem recognition

A

Stakeholders state what they require from the finished
product and this information is used to clearly define the problem and the system

59
Q

What are the requirements defined by

A

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
Q

What else does problem decomposition allow

A

The project to be developed in parralel

61
Q

What is divide and conquer

A

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
Q

Example of divide and conquer

A

Binary search

63
Q

Biggest advantage of divide and conquer

A

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
Q

What is a stack ovrerflow

A

when a computer program tries to use more memory space in the call stack than has been allocated to that stack.

65
Q

Representational abstraction

A

Excessive details removed

66
Q

Abstraction by generalisation

A

Grouping together section of problem with similar functionality allow code to be re used

67
Q

Backtracking

A

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
Q

Example of backtracking

A

Depth-first graph traversals

69
Q

What is data mining

A

Data mining is used in
software designed to spot trends or identify correlations between data which are not
immediately obvious (looking for patterns)

70
Q

What can insights from data mining be used to make

A

Data mining is used in
software designed to spot trends or identify correlations between data which are not
immediately obvious

71
Q

Crucial thing with data mining

A

, 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
Q

Heuristics

A

Non optimal approach to problem solving to find an approximate solution when standard solution is time consuming or resource intensive

73
Q

Example of heuristics

A

A* algorithm

74
Q

Performance modelling

A

Performance modelling eliminates the need for true performance testing by providing
mathematical methods to test a variety of loads on different operating systems.

75
Q

Advantages of performance modelling

A

cheaper, less time-consuming or safer method of
testing applications

76
Q

Use of performance modelling

A

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
Q

Pieplining

A

faster, as modules are divided into individual
tasks, with different tasks being developed in parallel

78
Q

What is a production line

A

Traditionally, the output of one process in pipelining
becomes the input of another, resembling a production
line.

79
Q

Visualisation

A

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
Q

What is polymorphism

A

Polymorphism is a concept in programming that allows objects to take on different forms or behaviours.

81
Q
A