7/CS Lent term

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/70

flashcard set

Earn XP

Description and Tags

topics covered: algorithms, python, micro:bit

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

71 Terms

1
New cards

What are the inputs of a micro:bit?

Buttons, compass and accelerometer

2
New cards

What are the outputs of a micro:bit?

Speaker and LEDs

3
New cards

What is sequencing?

The concept that instructions are run in the order that they are written.

4
New cards

What is an interaction in python?

The concept in which you ask the user to enter an input to print statements.

5
New cards

What notation is used for an interacting input in phyton?

input()

6
New cards

If I want to ask for someone’s name using an input and store it in a variable called ā€˜name’. What is the code I should use?

name = input()

7
New cards

What does int() do to an interacting input?

Converts the input from a text input to an integer input.

8
New cards

What does float() do to an interacting input?

Converts the input from a text input to a decimal input.

9
New cards

If I wanted to ask someone for their favourite integer and store it in a variable called ā€œintegerā€. How would I code it?

integer = int(input())

10
New cards

If I wanted to ask someone for their favourite decimal and store it in a variable called ā€œdecimalā€. How would I code it?

decimal = float(input())

11
New cards

What notation is used for assignment?

=

12
New cards

What is assignment?

The act of storing a value in a variable.

13
New cards

What notation is used to compare a value to a variable?

==

14
New cards

What is a variable?

Containers that hold data in code; the data can change later during execution.

15
New cards

How is data assigned to a variable?

=

16
New cards

What is concatenation?

The act of linking strings and variables using +

17
New cards

How would you print the word: Hello?

print(ā€œHelloā€)

18
New cards

How would you print the variable Hello?

print(Hello)

19
New cards

How would you print the string Hello and the variable name1?

print(ā€œHelloā€ + name1)

20
New cards

What is selection?

An algorithmic construct in which a condition is used to decide which instructions (if any) will be executed creating choices/branches in code.

The algorithm selects which path to follow based on the outcome of a true/false condition. (if/elif/else)

21
New cards

What 3 coding terms are used in selection?

if, elif, else

22
New cards

What comes first in the 3 selection coding terms?

if

23
New cards

What comes last in the 3 selection coding terms?

else

24
New cards

What comes in the middle of the 3 selection coding terms?

elif

25
New cards

What do you have to do to all code inside a selection term? (if/elif/else)

Indent it.

26
New cards

What case do the selection terms have to be in a program? (if/elif/else)

Lowercase.

27
New cards

What punctuation comes after a selection term?

A colon.

28
New cards

What has to be after an if or elif statement. (Not punctuation)

A comparison.

29
New cards

What syntax are used for comparisons?

==, <, >, <=, >= and !=

30
New cards

Comparison syntax: What does == mean?

Equal to

31
New cards

Comparison syntax: What does > mean?

Greater than

32
New cards

Comparison syntax: What does < mean?

Less than

33
New cards

Comparison syntax: What does <= mean?

Less than or equal to.

34
New cards

Comparison syntax: What does >= mean?

Greater than or equal to.

35
New cards

Comparison syntax: What does != mean?

Not equal to.

36
New cards

What is an algorithm?

An unambiguous (clear) sequence of instructions which must terminate and solve a problem or perform a task.

37
New cards

What are the features of an algorithm?

  • It is unambiguous

  • It must stop

  • It must solve a problem or perform a task

  • It must be performed in a certain order

38
New cards

What are the four standard flowchart shapes?

Oval, parallelogram, rectangle and diamond

39
New cards

How can an algorithm be presented?

  • Plain English

  • Flowchart

  • Pseudocode (blocks)

  • Code

40
New cards

What is the use of an oval in a flowchart?

It denotes the start/end of an algorithm

41
New cards

What is the use of an arrow in a flowchart?

It denotes the direction of the algorithm in which the sequence flows.

42
New cards

What is the use of a parallelogram in a flowchart?

It denotes an input/output.

43
New cards

What is the use of a rectangle in a flowchart?

It denotes a process.

44
New cards

What is the use of a diamond in a flowchart?

It denotes a decision.

45
New cards

What comes out of a diamond in a flowchart?

2 arrows labelled yes/no to denote a decision.

46
New cards

What is a dry run?

The process of executing an algorithm on pencil and paper to ensure it is functioning.

47
New cards

What is a trace table?

A method to record and work out variable values and outputs according to code with each column representing a variable/output and new row representing a change of value in a variable.

48
New cards

What is iteration?

The repetition of a section of an algorithm using a decision

49
New cards

What is the keyword used to start a loop in python?

while

50
New cards

Why is repetition important in algorithms?

To simplify the repeating of steps if needed in an algorithm.

51
New cards

Which flowchart shape starts a loop?

Decision; kite

52
New cards

What are your columns in a trace table?

Your variables and the output.

53
New cards

What are the two types of loops?

  • Count controlled loop

  • Condition controlled loop

54
New cards

How do you show which lines of code are in a loop?

Indentation.

55
New cards

What comes at the end of ā€œwhileā€?

:

56
New cards

What is the difference between a count controlled loop and a condition controlled loop?

A count controlled loop is stopped after certain code is repeated a certain amount of times.

Whereas, a condition controlled loop is stopped after certain code is repeated until a certain condition is met.

57
New cards

What is a ā€œloopā€?

A sequence of code that is repeated over and over again until a count/condition is met.

58
New cards

What is a count controlled repetition construct?

The concept/construct that an action is repeated a given number of times.

59
New cards

What is a condition controlled repetition construct?

The concept/construct that an action is repeated until a condition is met.

60
New cards

What is a while construct?

The concept/construct that allows a group of instructions to be repeated over and over, using ā€œwhileā€.

61
New cards

On a flowchart, how is the indented section of a loop shown?

The end of the indented section will have an arrow linking back to what started the loop, the code in between will be the indented section of a loop. This also shows a loop effectively.

62
New cards

How can you make a condition controlled loop a count controlled loop (by technicality).

By intentionally making the condition met in a condition controlled loop a variable which goes up by a certain value each time and reach the condition (a certain number). Which is what is used for a ā€œcount controlled loopā€ in python.

63
New cards

What is an input?

data sent to a computer

64
New cards

What is an output?

data processed by a computer with an outcome

65
New cards

Define the term ā€œfiniteā€.

something which has a clear start and end

66
New cards

Define the term ā€œunambiguousā€

something that is clear and precise

67
New cards

What is a flowchart?

graphical method of presenting an algorithm using symbols and arrows.

68
New cards

What is psuedocode?

method of describing an algorithm with structure similar to an actual code.

69
New cards

What is syntax?

notations/symbols which put together key parts of code, making algorithms able to do the right things.

70
New cards

What is a syntax error?

an error caused by a misuse of syntax

71
New cards

What is repetition?

Algorithmic construct in which a group of statements is executed repeatedly for a certain amount of times/until a condition is met