Section 2 - Problem solving and theory of computation Flashcards

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

What is software?

A

The name given to any program written for a computer

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

What are the stages in writing software?

A

Analysis > Design > Implementation > Testing > Evaluation
One phase doesn’t have to be finished before another begins

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

What happens during analysis?

A

The requirements and goals of the project must be established with a data model created. The needs of the end user are considered, and alternative solutions may be suggested

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

What happens during design?

A

Data structures will be specified, algorithms, user interfaces, screen designs and reports will all be designed

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

What happens during implementation?

A

The program code is written

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

What happens during testing?

A

The whole system must be tested for the presence of errors, using selected test data covering normal, boundary and erroneous data

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

What happens during evaluation?

A

The system is evaluated according to given criteria

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

What is a puzzle’s input?

A

Something that defines an instance of the puzzle. The instance is either specific or general

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

What is an exhaustive search?

A

Trying every possible combination of numbers

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

How does a binary search work?

A
  • Look at the middle item of a sorted list and compare it to the term you are looking for. If it is the correct term then stop searching. If it is greater than the item being sought, discard the second half of the list. Else, discard the left half. Repeat until the item is found
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the goal of structured programming?

A

To improve the clarity and maintainability of programs

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

What programming structures are used in structured programming?

A

Sequence, selection, iteration

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

What are block-structured languages?

A

Languages like Python, C# and Pascal. The programs are made up of a series of blocks

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

What is a block?

A

A section of code consisting of 1 or more statements. Each block should have 1 entry and 1 exit point.

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

What is top-down design?

A

The technique of breaking down a problem into the major tasks to be performed, before breaking each part down even further into its own self-contained module or subroutine

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

What are the advantages of structured (modular) programming?

A
  • Individual modules can be separately tested
  • Modules can be kept in a module library to be reused in other programs
  • Large programs can be split into modules that are easier to read, debug and maintain
  • Several programmers can work on separate modules, shortening development times
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is a hierarchy chart?

A

A tool used to represent the structure of a program, showing how the modules relate to one another. The chart is depicted as an upside down tree shape

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

What is the downside of a hierarchy chart?

A

It does not show the detailed program structures required in each module

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

What is an algorithm?

A

A set of clear and precise steps that produce the correct output for any set of valid inputs. It must always terminate at some point.

20
Q

What are the properties of a good algorithm?

A
  • It should allow for invalid inputs
  • It should execute efficiently, in as few steps as possible
  • It should be designed in a way that others can understand it
21
Q

What are the most common types of algorithms?

A
  • Internet-related algorithms
  • Route-finding algorithms
  • Compression algorithms
  • Encryption algorithms
22
Q

What is the purpose of internet-related algorithms?

A

They are used to manage and manipulate huge amounts of data stored on the internet

23
Q

What is the purpose of route-finding algorithms?

A

They work out the most efficient route to get from A to B. This could be cars on a road or data packets across a network

24
Q

What is the purpose of compression algorithms?

A

They are used to compress data files so they can be transmitted faster or held in smaller amounts of storage

25
Q

What is the purpose of encryption algorithms?

A

They encrypt data so even if it is intercepted, it cannot be read

26
Q

What is psuedocode?

A

A method of expressing the solution in a way that can easily be translated into a programming language

27
Q

How does a bubble sort work?

A

Go through the array. comparing each item with the one next to it. If greater, switch them. Repeat the process n-1 times, reducing the number of items to be examined by 1 each time

28
Q

What can you do to help interpret a program?

A
  • Read the comments in the program
  • Look at the variable names to see if they give any clues
  • Follow the steps in the program
  • Try a “dry run” with some test data
29
Q

What is the purpose of testing?

A

To try and uncover undetected errors

30
Q

What data should be chosen to test a program with?

A
  • Normal
  • Boundary
  • Erroneous
31
Q

What is normal data?

A

Data within the range you would expect, and the data type you would expect

32
Q

What is boundary data?

A

Data at the ends of the expected range (or just either side of it)

33
Q

What is erroneous data?

A

Data that is outside of the expected range and the wrong data type

34
Q

What should you state for each test?

A
  • The purpose of the test
  • The expected result
  • The actual result
35
Q

What criteria could you evaluate a program against?

A
  • Does it meet the performance criteria?
  • Does it always perform as expected?
  • Is the system reliable?
  • Is the system easy to use?
  • Has the system been well documented and is easy to maintain?
  • How cost-effective is the system?
  • How future proof is the system?
36
Q

What are the 2 steps for computational thinking?

A
  • Formulate the problem as a computational problem
  • Try to construct an algorithm to solve the problem
37
Q

What is abstraction?

A

Removing unnecessary details from a program

38
Q

What is representational abstraction?

A

A representation arrived at by removing unnecessary details

39
Q

What is abstraction by generalisation?

A

Abstraction by grouping common characteristics to arrive at a hierarchical relationship of the “is a kind of” type

40
Q

What does abstraction allow us to do?

A

Separate the physical reality of a problem from the logical view

41
Q

What is procedural abstraction?

A

Using a procedure to carry out a sequence of steps in order to achieve a task

42
Q

What is functional abstraction?

A

An additional abstraction that can be applied onto the procedure gotten from procedural abstraction. You disregard the particular computational method.

43
Q

What is data abstraction?

A

A methodology that enables us to isolate how a compound data object is used from the details of how it is constructed.

44
Q

What is problem abstraction?

A

Details are removed until the problem is represented in a way that is possible to solve because the problem reduces to one that has already been solved.

45
Q

What is procedural decompostion?

A

Breaking a problem into a number of sub-problems, so that each sub-problem accomplishes an identifiable task, which might itself be further subdivided.