computational thinking - topic one

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/64

flashcard set

Earn XP

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

65 Terms

1
New cards

what is computational thinking

the process used to solve complex problems -formulating a problem and expressing a solution the way a computer can carry it out

2
New cards

what are the two stages involved in computational thinking ?

decomposition

abstraction

3
New cards

what is abstraction

abstraction involves identifying the key parts of the problem and removing and unnecessary detail so it becomes easier to solve e.g importing random to shuffle a deck of cards

4
New cards

what is decomposition

decomposition is the braking down a complex problem into a smaller, manageable parts which are easier to solve

5
New cards

what are the three steps of decomposition

  • identifying the main problem

  • list the main sub problems,functions or tasks

  • break down into smaller sub-problems or sub tasks which can they be complete separately

6
New cards

what is a subroutine

are small programs that are written within a larger, main program. The purpose of a subprogram is to perform a specific task.

7
New cards

what are the two types of subprograms

  • procedures

  • functions

8
New cards

benefits of a subroutine

  • making debugging and maintaining the program is easier as subroutines are usually short and separate form the main code

  • subroutines can be tested separately and shown to be correct

  • a particular subroutine can be called several times in the same program and may also be saved to a subroutine library to be used in other programs

9
New cards

what is a procedure ?

procedure is a subprogram that performs a specific task. When the task is complete, the subprogram ends and the main program continues from where it left off.

10
New cards

how do you call a procedure

ogrammers use the procedure name and include any parameter values that the procedure needs

11
New cards

what is a function

function works in the same way as a procedure, except that it processes data and returns a result back to the main program.

12
New cards

how do you call a function

programmers use the function's identifier, the parameter value to be passed into the function, and a variable for the function to return and assign a value into

13
New cards

what are some in built functions

  • int - converts strings or floats into integers

  • str - converts a number into a string

  • asc - finds the ASCII number of a character

14
New cards

advantages of flow charts

  • it is easy to see how a program flows

  • flowcharts follow an international standard

15
New cards

disadvantages of flowcharts

  • with a large program, the diagrams can become huge and therefore difficult to follow

  • any changes to the design may mean a lot of the diagram has to be redrawn

16
New cards

symbol for input output

parallelogram

17
New cards

symbol for decision

diamond

18
New cards

symbol for process

rectangle

19
New cards

symbol for subroutine

rectangle with a lines both sides

20
New cards

symbol for terminal (start/end)

oval

21
New cards

what is a problem with flowcharts to develop an algorithm

it doesn’t translate into progam code very easily

22
New cards

whats is pseudo code

a method of writing up a set of instructions for a computer program using plain English.

23
New cards

benefit of pseudo code

  • it can be quickly and easily converted into an actual programming language as it is similar to a programming language

  • it is fairly easy to understand, even for non-programmers

  • it does not matter if there are errors in the syntax - it is usually still obvious what is intended

  • changes to the design can be incorporated quite easily

24
New cards

disadvantages of pseudocode

  • It can be hard to see how a program flows

  • It can be time consuming to produce.

25
New cards

what are the three basic programming constructs

  • sequence

  • selection

  • iteration

26
New cards
27
New cards

what is a sequence

is the order in which instructions occur and are processed.

28
New cards

what is iteration

Iteration is the repeated execution of a section of code when a program is running.

29
New cards

what are the 2 types of iteration

  • count-controlled

  • condition-controlled

30
New cards

what is count-controlled iteration

repeatedly executes a section of code a fixed number of predetermined times- using a FOR loop, which uses a control variable to determine what code is repeatedly executed and how many times.

31
New cards

what is condition controlled iteration

epeatedly executes a section of code until a condition is met - or no longer met. The two most common types of condition-controlled iteration are:

  • while loops, which use the statements WHILE and END WHILE

  • repeat loops, which use the statements REPEAT and UNTIL

32
New cards

what is selection

determines which path a program takes when it is running

33
New cards

what is an algorithm

a sequence of steps that can be followed in order to complete a task e.g recipes

34
New cards

what is the diffidence between a computer program and an algorithm

a computer program is one way of implementing an algorithm in a particular language but its the series of the instructions and the order of those instructions that are the basis of any algorithm

35
New cards

what is nested selection

its where a decision has a decision nested inside it

36
New cards

what is a list?

a collection of variables of the same or different types, enclosed in square brackets

37
New cards

how is a list referenced ?

using an index starting at 0 for the first item

38
New cards

how would you refer to lennie in the list ?

playername =[“corrie”,”ben”,”gordon”,”lennie”,”pete”]

playername[3]

39
New cards

what is a trace table ?

is used to show how variables change during execution of a program

40
New cards

what are three types of error?

  • syntax

  • logic

  • runtime

41
New cards

what is a syntax error ?

prevent program from running due to spelling/grammar mistake in your code

42
New cards

what is a logic error ?

a mistake in a program's code that causes it to behave unexpectedly or produce incorrect results, without generating an error message. e.g x>5 rather than x>=5

43
New cards

what is a runtime error?

it will be detected when the program is running -may be caused by a logic error or by the program not allowing for condition such as user inputting 0 or entering no data at all

44
New cards

what is a binary search?

a search that can be used to search a list that is in numerical or alphabetical order -works by repeatedly dividing in half portion of the list that could require one data item

45
New cards

what are the advantages and disadvantages of binary search

  • list needs to be ordered

  • more efficient than linear search

46
New cards

what is a linear search

each item will be checked one by one in the list

47
New cards

what are the advantages and disadvantages of linear search

  • if list is large it will take a very long time

  • list does not need to be ordered

48
New cards

what is bubble sort ?

bubble sort works by repeatedly going through a list to be sorted swapping adjacent elements if they are in the wrong order

49
New cards

disadvantage of bubble sort

  • not efficient for large lists

50
New cards

what is merge sort

list is repeatedly divided into two until all the elements are separated individually. Pairs of elements are then compared, placed into order and combined. The process is then repeated until the list is recompiled as a whole.

51
New cards

describe the two stages of merge sort

  • stage 1 : the list is successively divided in half , forming two sunsets , until each sub list is one length

  • stage 2:Each pair of subs lists is repeatably merged to produce new sorted sub lists until there is only one list remaining-the sorted list

52
New cards

what type of algorithm is merge sort

recursive algorithm which means the subroutine calls itself

53
New cards

what type of algorithm is bubble sort

iterative algorithm meaning that it uses WHILE and/ for loops repeating the same sets many times

54
New cards

which algorithm is more efficient bubble sort or merge sort

merge sort

55
New cards

how can the efficiency of algorithms be measured ?

  • by the time it takes to execute

  • amount of memory required for given data set

56
New cards

what is a transistor ?

Microscopic devices that open and close circuits to communicate electrical signals. CPUs contain millions of transistors.

57
New cards

what two states do a computer have ?

  • on - a current is flowing through the component (1)

  • off - a current is not flowing through the component(0)

58
New cards

what is a logic gate ?

a logic gate is a series of transistors connected together to give one or more outputs. Each output is based on the input or combination of inputs supplied to it.

59
New cards

what are the three types of logic gates ?

  • AND gate

  • OR gate

  • NOT gate

60
New cards

what is a AND gate

An AND gate uses two inputs to generate one output. The output is 1 (TRUE) only if both of the inputs are 1 (TRUE).

<p><span>An AND gate uses two inputs to generate one output. The output is 1 (TRUE) only if both of the inputs are 1 (TRUE).</span></p>
61
New cards

what is an OR gate ?

An OR gate uses two inputs to generate one output. The output is 1 (TRUE) only if either or both of the inputs are 1 (TRUE).

<p><span>An OR gate uses two inputs to generate one output. The output is 1 (TRUE) only if either or both of the inputs are 1 (TRUE).</span></p>
62
New cards

what is a NOT gate ?

a NOT gate uses one input to generate one output. A NOT gate inverts the input. The output is 1 (TRUE) if the input is 0 (FALSE), and the output is 0 (FALSE) if the input is 1 (TRUE).

<p><span>a NOT gate uses one input to generate one output. A NOT gate inverts the input. The output is 1 (TRUE) if the input is 0 (FALSE), and the output is 0 (FALSE) if the input is 1 (TRUE).</span></p>
63
New cards
64
New cards
65
New cards