7 Algorithm design and problem solving Flashcards

1
Q

What are some different types of programming languages?

A

Declarative, object-oriented, event driven, procedural

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

What is a declarative programming language?

A

Language where rules are declared, you can ask questions, answer given based upon the rules

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

What is an object-oriented programming language?

A

Language where user can create objects that have attributes and methods

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

What is an event driven programming language?

A

A language where there are buttons, text boxes and items user can interact with, each item has its own code which is only run when the item is clicked or changed, all code of program not run from start to finsih

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

What is a procedural programming language?

A

Language with statements run in order they are written in, uses subroutines which can be called from other parts of the program

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

What is the program development life cycle?

A

A series of structured steps followed to produce a system

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

What are some different varieties of the program development life cycle?

A

Cyclic, spiral, waterfall and rapid development

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

What are the stages of the program development life cycle?

A

Analysis, design, coding and testing

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

What is decomposition?

A

The process of taking a problem or system, and splitting it into smaller parts (sub-problems, sub-systems) which it turn can be split into smaller parts

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

What is the analysis stage of the program development life cycle?

A

The first stage of the cycle where the problem is investigated

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

What is the design stage of the program development life cycle?

A

The second stage of the cycle where the program is planned out and the problem is decomposed

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

What things can be used in the design stage of the program development life cycle to plan out the program?

A

Structure diagram, flowcharts and pseudocode

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

What is a structure diagram?

A

A hierarchical diagram that shows a decomposed system, the name of the program at the top and its subprograms below

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

What is a flowchart?

A

A diagrammatic representation of an algorithm with symbols for decisions, processes, start / stop points and arrows to show the direction of flow

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

In a flowchart, how is the content inside each box written?

A

Written as words or pseudocode statements

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

In a flowchart, what is the symbol for a each thing?

A

Start / stop - curved rectangle thing, process - rectangle, input / output - parallelogram, decision - diamond (think)

17
Q

What is pseudocode?

A

Code-like statements used to design an algorithm but do not follow any specific language

18
Q

What is important in pseudocode and what can be imperfect?

A

Logic is important, syntax can be imperfect

19
Q

What is the coding stage of the program development life cycle?

A

The third stage of the cycle where a program is written in a programming language, includes iterative testing while program is being developed

20
Q

What is the testing stage of the program development life cycle?

A

The fourth stage of the cycle where a program is repeatedly used with test data to ensure it fully works, doesn’t crash and meets all requirements

21
Q

What are the four types of test data and what are their details?

A

Normal - data program should accept, abnormal - data program shouldn’t accept, extreme - data on edge of what is accepted, boundary - data on edge of being accepted and rejected

22
Q

What is a search algorithm?

A

An algorithm which checks a set of data to see if a specific value exists in it or not

23
Q

What is a sorting algorithm?

A

An algorithm which takes a set of data and rearranges it to be in a specific order

24
Q

What is linear search?

A

A search algorithm which checks each item one at a time, and keeps continuing to the next item until it finds the data it is searching for or reaches the end

25
Q

What is bubble sort?

A

A sorting algorithm which takes values 1 and 2, swaps them if they are the wrong way round, checks values 2 and 3, and repeats for the entire list.

26
Q

How does a bubble sort algorithm stop?

A

If the number of times the algorithm has been through the list = the number of elements in the list - 1, or if the algorithm has been through the list without making any changes

27
Q

What are some number-related things program can do?

A

Totalling, counting, finding the minimum, finding the maximum, finding the average (can be mean)

28
Q

What is validation in computer science?

A

The checking of data to make sure it is reasonable and within set bounds

29
Q

What are some types of validation?

A

Range check (checks if data within one or two numeric bounds), length check (checks number of characters within set limit), type check (checks data is the correct type), presence check (checks if data has been entered), format check (checks if data is entered in correct format / order)

30
Q

What is a check digit?

A

Error detection method where check digit is calculated from set of numbers, input with numbers, calculation performed on data again and check digit values compared to see if data entered is correct

31
Q

What is verification in computer science?

A

The process of checking that data is entered accurately, that it is the same as the original

32
Q

What are some examples of verification, and what happens in each?

A

Visual check - visually checking the entered data with the original side-by-side; double entry check - same data entered twice, usually by different people, and then entered data compared

33
Q

What is a trace table and its structure?

A

A structure which is completed when manually running an algorithm line by line, each column in a table for one variable and column for all outputs

34
Q

What can a trace table be used for?

A

Helps to follow a program to work out its purpose (see what changes made and when) and find and correct errors (shows what program actually does, different from what it should do, error found)

35
Q

What methods can computer programmers use to find errors?

A

Using a trace table, dry running by reading code, use featured within Integrated Development Environment (IDE)