computational thinking - topic one

studied byStudied by 3 people
0.0(0)
Get a hint
Hint

what is computational thinking

1 / 64

flashcard set

Earn XP

65 Terms

1

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

New cards
2

what are the two stages involved in computational thinking ?

decomposition

abstraction

New cards
3

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

New cards
4

what is decomposition

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

New cards
5

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

New cards
6

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.

New cards
7

what are the two types of subprograms

  • procedures

  • functions

New cards
8

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

New cards
9

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.

New cards
10

how do you call a procedure

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

New cards
11

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.

New cards
12

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

New cards
13

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

New cards
14

advantages of flow charts

  • it is easy to see how a program flows

  • flowcharts follow an international standard

New cards
15

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

New cards
16

symbol for input output

parallelogram

New cards
17

symbol for decision

diamond

New cards
18

symbol for process

rectangle

New cards
19

symbol for subroutine

rectangle with a lines both sides

New cards
20

symbol for terminal (start/end)

oval

New cards
21

what is a problem with flowcharts to develop an algorithm

it doesnā€™t translate into progam code very easily

New cards
22

whats is pseudo code

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

New cards
23

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

New cards
24

disadvantages of pseudocode

  • It can be hard to see how a program flows

  • It can be time consuming to produce.

New cards
25

what are the three basic programming constructs

  • sequence

  • selection

  • iteration

New cards
26
New cards
27

what is a sequence

is the order in which instructions occur and are processed.

New cards
28

what is iteration

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

New cards
29

what are the 2 types of iteration

  • count-controlled

  • condition-controlled

New cards
30

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.

New cards
31

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

New cards
32

what is selection

determines which path a program takes when it is running

New cards
33

what is an algorithm

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

New cards
34

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

New cards
35

what is nested selection

its where a decision has a decision nested inside it

New cards
36

what is a list?

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

New cards
37

how is a list referenced ?

using an index starting at 0 for the first item

New cards
38

how would you refer to lennie in the list ?

playername =[ā€œcorrieā€,ā€benā€,ā€gordonā€,ā€lennieā€,ā€peteā€]

playername[3]

New cards
39

what is a trace table ?

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

New cards
40

what are three types of error?

  • syntax

  • logic

  • runtime

New cards
41

what is a syntax error ?

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

New cards
42

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

New cards
43

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

New cards
44

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

New cards
45

what are the advantages and disadvantages of binary search

  • list needs to be ordered

  • more efficient than linear search

New cards
46

what is a linear search

each item will be checked one by one in the list

New cards
47

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

New cards
48

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

New cards
49

disadvantage of bubble sort

  • not efficient for large lists

New cards
50

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.

New cards
51

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

New cards
52

what type of algorithm is merge sort

recursive algorithm which means the subroutine calls itself

New cards
53

what type of algorithm is bubble sort

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

New cards
54

which algorithm is more efficient bubble sort or merge sort

merge sort

New cards
55

how can the efficiency of algorithms be measured ?

  • by the time it takes to execute

  • amount of memory required for given data set

New cards
56

what is a transistor ?

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

New cards
57

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)

New cards
58

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.

New cards
59

what are the three types of logic gates ?

  • AND gate

  • OR gate

  • NOT gate

New cards
60

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>
New cards
61

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>
New cards
62

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>
New cards
63
New cards
64
New cards
65
New cards

Explore top notes

note Note
studied byStudied by 45 people
... ago
5.0(1)
note Note
studied byStudied by 2 people
... ago
5.0(1)
note Note
studied byStudied by 21 people
... ago
5.0(1)
note Note
studied byStudied by 35 people
... ago
5.0(2)
note Note
studied byStudied by 23 people
... ago
5.0(1)
note Note
studied byStudied by 6 people
... ago
5.0(1)
note Note
studied byStudied by 15697 people
... ago
4.9(156)

Explore top flashcards

flashcards Flashcard (68)
studied byStudied by 138 people
... ago
5.0(2)
flashcards Flashcard (42)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (25)
studied byStudied by 9 people
... ago
5.0(1)
flashcards Flashcard (35)
studied byStudied by 4 people
... ago
5.0(1)
flashcards Flashcard (21)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (53)
studied byStudied by 108 people
... ago
5.0(1)
flashcards Flashcard (172)
studied byStudied by 13 people
... ago
5.0(1)
flashcards Flashcard (33)
studied byStudied by 5 people
... ago
5.0(1)
robot