Topic 4 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

List two criteria to use when assessing whether a solution is satisfactory.

A
  1. Speed

2. Readability

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

What are sub-procedures?

A

Sub-procedures are procedures that have no use on their own but are used in other procedures to contribute to solving a larger problem, which are known as methods in Java.

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

List 3 benefits of modular programming.

A
  1. Reusability
  2. Debugging
  3. Organisation (split up workload)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

List two examples of decision making statements.

A
  1. if (else)

2. switch

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

Every decision making statement returns a…

A

boolean

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

What are the 3 parts of a solution?

A
  1. Input
  2. Processes/procedures
  3. Output
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why is pre-planning important?

A

E.g.

we need somewhere to store information about what to code, inputs, outputs etc.

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

What are the two tasks in a software development cycle that must be conducted concurrently?

A

Testing and development

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

What are gantt charts used for?

A

Managing the period of time in which a task will be in development

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

What are pre-conditions? E.g.?

A

Pre-conditions are things that need to be tested before executing a solution. It is necessary for some solutions because the functions of a solution may have to rely on these pre-conditions, e.g. connecting to a database requires internet connection

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

What are post-conditions? E.g.?

A

Post-conditions are things that must be tested in order to check that the solution has done what it’s supposed to have done, e.g. printing out the results and checking if it is reasonable.

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

When are exceptions thrown?

A

An exception occurs when the program expects something but the input does not match as expected.

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

List 3 advantages of implementing parts concurrently.

A
  1. Efficiency/time
  2. Organisation in a large group
  3. Some parts may depend on other parts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is concurrent processing?

A

Essentially multitasking, a real life example of this is the building of a car, where the different parts are pre-built separately but concurrently.

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

What is a major strength of concurrent processing?

A

Speed

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

List two weaknesses of concurrent processing.

A
  1. Cannot be used when processes of constructing a solution must be linear (i.e. one function depends on the output of another)
  2. Difficult to code, debug and trace
17
Q

What is an abstraction?

A

Abstraction in a solution to a problem in the design level, showing a concept of an object rather than the actual object.

Abstraction is used for hiding the unwanted data and giving relevant data and focuses on what the object does rather than how it does it.

18
Q

What is the structure of a while loop in pseudocode?

A

loop while CONDITIONS
actions
end loop

19
Q

What is the structure of a do while loop in pseudocode?

A

loop until CONDITIONS
actions
end loop

20
Q

What are the two most common ways of using linear arrays?

A

Sorting and searching

21
Q

List two types of sorting and explain how they work.

A

Bubble - goes through an array and compare two adjacent elements, swap the two elements if the order in which they’re in are not do not satisfy the results we’re looking for.

Selection - goes through an array at every element and looks for any value that is smaller/larger (depending on what ways we’re sorting), if there’s one value that is smaller/larger, swap them.

22
Q

List two types of searching and explain how they work.

A

Sequential - goes through the array and finds the target value
Binary (requires an sorted list) - Starts in the middle of the array and checks if the desired result is in the first or second half of the list by comparing whether the target value is smaller than or larger than the middle value. The other half is then discarded and the process is used for this sub-array until there is only one element left.