unit 11 Flashcards

1
Q

what is an IDE?

A

an integrated development environment which enables the user to enter edit and compile programs

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

what features does an IDE have?

A

automatic indentation
auto complete commands
comment a region
syntax errors

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

what debugging facilities does an IDE have?

A

setting a breakpoint causing program to stop at that line
set a watch on a variable so value is displayed each time it changes
trace execution of a program

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

what is an algorithm?

A

a sequence/set of instructions that can be followed to solve the problem

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

what is pseudocode?

A

statements in between english and a programming language to help think out program steps needed

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

what is selection?

A

if statements
switch case statements
used to test conditions and outcome determines program flow

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

what is a switch case statement?

A

conditional statement that performs multiple comparisons based on value of expressions

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

what is iteration?

A

repetition
a sequence of instructions is repeated multiple times

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

what are the 3 iterative loops?

A

while, for, do until/repeat until

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

what is the difference between a while loop and a do until loop?

A

while - condition is tested upon entry to the loop
do - condition tested at end of the loop (always run at least once)

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

what is the difference between a while and for loop?

A

while - indefinite iteration
for - definite iteration (count controlled loop, specified number of times)

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

what happens when a parameter is passed by value?

A

copy of the actual value is made and assigned to function’s parameter
any changes to the parameter do not affect original value
copy of value is destroyed at the end

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

what happens when a parameter is passed by reference?

A

function receives memory address of the value rather than a copy of the value
any changes made to parameter will directly affect the original value
directly modify original data

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

what are the advantages of passing by reference?

A

can directly modify original data so good for large data structures

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

what are the disadvantages of passing by reference?

A

can lead to unwanted side effects as changes in code can affect other parts of function

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

what are the advantages of passing by value?

A

original data remains unchanged so it is suitable when you want to protect the original value

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

what are the disadvantages of passing by value?

A

can lead to performance overhead when working with large data structures as a copy is made

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

what is recursion?

A

process of a function calling itself to execute a task

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

what are the 3 features of recursion?

A

function must call itself
a base case - it can return a value without further recursive calls
an exit case - must be reachable after a finite number of times

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

why do we need a base case/stopping condition?

A

to avoid stack overflow errors which result in program crashes
if no base case, it will call itself indefinitely which uses excessive memory

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

what are the benefits of recursion?

A

can be expressed in a more concise way
simply stating what needs to be done without focusing on how makes it more readable

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

what are the disadvantages of recursion?

A

repeated function calls can be CPU intensive leading to slower execution
recursive code is more difficult to debug and track state of program
not all problems can be solved recursively

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

what are the advantages of iteration?

A

more efficient than recursion, less memory usage
easier to debug
wider range of problems

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

what are the disadvantages of iteration?

A

can get very complex and use more lines of code than recursion
less concise than recursion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
what is a variable?
a named storage location in memory used to store data that can change during program execution
26
what is a global variable?
a variable declared at the outermost level of a program/ declared outside an indented block of code
27
what is global scope?
lets the variables be accessed and modified from any part of the program
28
what is the need for global variables?
data sharing - allow data to be passed between different modules easily without the use of parameter passing persistent storage - retain their values throughout execution meaning they are suitable for storing data that needs to persist across function calls global configuration - used to store config settings or constants
29
what are the advantages of global variables?
only needs to be declared once dont need to keep passing parameters between different modules
30
what are the disadvantages of global variables?
always stored in memory which uses up memory difficult to maintain as it's difficult to understand where variables are changed difficult to test single blocks of code as entire program needs to be run
31
what is a local variable?
a variable declared within a specific scope such as a function or code block only accessible within the block they are defined
32
what are the benefits of local variables?
encapsulate data within function providing data hiding and preventing unwanted access use same variable name in different locations limited lifetime as memory is released when the variable is destroyed
33
what are the drawbacks of local variables?
creates unnecessary memory overhead due to repeatedly creating+destroying variables excessive use within nested code can reduce code readability
34
how do you define a class Cars in pseudocode?
class Cars private name private model end class
35
what is the constructor method for cars?
car1 = new Cars ("bob", "vauxhall")
36
how do you define a method in a class using pseudocode?
public procedure drive() // endprocedure
37
how do you inherit a class in psuedocode?
CLASS Cars INHERITS Vehicles
38
what is the difference between a getter and a setter?
a getter will return a value and a setter will set a value
39
what are computational methods?
a set of problem solving techniques that use algorithms and maths to analyse and solve problems using a computer
40
what are some real world constraints on computable problems?
computing power, speed, memory running models on regular machines may be limited
41
what is problem recognition?
determining if there is a problem that needs to be solved
42
what is problem decomposition?
breaking down a big problem into smaller sub problems until they can each be tackled individually
43
what is divide and conquer strategy?
strategy to make a complex task easier by breaking it into smaller more manageable tasks
44
what is the divide part of the strategy?
problem needs to be broken into sub problems
45
what is the conquer part of the strategy?
sub problems then need to be solved independently
46
what is the combine part of the strategy?
solutions to sub problems are then combined to form overall solution
47
what is backtracking?
a technique that is used when you don't have enough information to find a solution to a problem and will therefore explore all possible paths to find a possible solution
48
what is an example of backtracking?
traversing a tree and returning from leaf nodes
49
what are the benefits of backtracking?
guaranteed to find a solution if one exists easy to implement explore all possible paths
50
what are the disadvantages to backtracking?
not ideal for strategic problems can have high time complexity can consume a lot of memory solution may not always be optimal requires complete search of solution space
51
what is data mining?
when large quantities of data are turned into useful information so that patterns can be found
52
what is the purpose of data mining?
collecting data and generating insight modelling, forecasting, patterns ...
53
what are some areas data mining is used?
retail, finance, healthcare, business
54
how is data mining used in retail?
can analyse purchase history and browsing behaviour to generate insight
55
how is data mining used in healthcare?
data from records can be analysed to predict outbreaks anticipate flu cases and better resource allocation
56
how is data mining used in finance and banking?
machine learning models trained on historical data can be used to identify suspicious activities flag potential fraud
57
what are the advantages of data mining?
identify patterns and trends that may not be obvious to humans better predictions demand can be met in companies
58
what are the disadvantages of data mining?
requires very powerful computers with processing power inaccurate data can produce inaccurate results doesnt explain why patterns exist
59
what are heuristics?
a rule of thumb or educated guess to find a solution faster
60
what are the advantages of heuristics?
can usually find a solution close to the best solution available save time as you do not search every possibility very practical and easily implemented
61
what are the disadvantages of heuristics?
does not guarantee best solution trade off between accuracy and time
62
what is performance modelling?
when the behaviour of something is tested or simulated before it is used in the real world
63
what are the advantages of performance modelling?
stress testing can ensure a system can cope with a large set of data able to predict problems and how to act before they actually occur for real
64
what are the disadvantages of performance modelling?
the outcome of performance modelling is only as useful as accuracy of data rules that model uses are wrong then results are wrong
65
how is pipelining used as a computational method?
carrying out multiple instructions at the same time means multiple tasks can operate at the same time which increases the performance of a system
66
what is visualisation?
when data or concepts are presented in simpler forms for humans to understand more complex data
67
what are the advantages of visualisation?
can simplify concepts can make it easier to spot new trends can be used to explain situations
68
what are the disadvantages of visualisation?
cannot explain why something is the way that it is different people may interpret it differently
69
what are some examples of visualisation?
flowcharts (represent work flow or processes) UML diagrams (visualise a system's architecture)