KS2 Computer Science Programming Flashcards

1
Q

How can we reason logically to help us program?

A
  • Talk through steps
  • Follow algorithm steps
  • Decompose chunks
  • Visualise
  • Predict
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is decomposition and how can it help us program?

A

Decomposing is breaking a problem (such as what we want our algorithm to do) into smaller parts. Those smaller parts can then be broken down further and further until we are able to create our algorithm. This is all part of planning.

Decomposing can also be used when debugging. Looking at a larger chunk of your algorithm code and breaking down what each part does to work out where the bug is

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

What is abstraction and how can it help us program?

A

Abtracting is filtering out things that are not important in what you are doing at that moment. It means getting rid of unnecessary detail.

Abstraction, like decomposition, is a way of breaking a problem down and can be used when planning and also when debugging.

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

How can we evaluate when programming?

A
  • Testing a plan and algorithm to see if the results are as expected.
  • Evaluate useability of what has been created.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What strategies can we use to find and fix bugs?

Debugging

A

Incremental programming (checking the outcome every line or chunk, as you code).

Tracing (tracing with a finger each line or chunk, saying out loud what the program will do as you go trace).

Flow Tracing (Tracing that follows the program flow into and out of functions and subroutines).

Visualising (Used alongside tracing, imagine what the user will see as each line or chunk of code is traced).

Isolating (Taking a line or chunk of code away from the program to see if the bug is in that chunk or work on the isolated chunk itself to see if the bug is in that section.

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

What are operators?

A

Operators are commands that come from mathematics.

Some of these compare:

< (less than)
> (greater than)
**= **(the same as)

Some of these create conditions:
and
or

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

What is boolean?

A

True or false values.

Used with operators. If an operator is true then you can create your algorithm to do what follows. For example:

IF (speed > 5) THEN limit top speed.

The boolean value will be TRUE if speed is greater than 5 and it will limit the top speed.

It will be FALSE and not limit the top speed if speed is less than 5.

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

integer, string

What is a variable?

A

The root word of variable is vary, which means: change from what it was already.

A variable is a way of storing a number or letters than can be changed while the program is running.

A whole number in a variable is called an integer.
Letters or words in a variable are called a string.

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

What is a function?

A

The word function means to do somthing it has been created to do.

In a program, a function is a chunk of code that has a particular use of ‘function’. It can be used to make code more elegant and simpler to decode.

You can call a function to run in your program multiple times so that you do not have to write the same thing more than once.

You can pass variables into your function (called arguments) from your main program or other functions.

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

In programming, what are nested statements?

A

Nested statements are like boxes inside other boxes. Each box has its own instructions to follow. If the right conditions are met, a box is opened and the instructions inside are followed in the right order.

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