2.1 Algorithm Flashcards

1
Q

2.1.1 - Computational thinking

What is abstraction?

A
  • ignoring unnecessary information
  • focusing only on the important facts
  • simplifies a problem to make it less complex
  • program becomes more straightforward to understand the problem and create a solution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

2.1.1 - Computational thinking

What decomposition?

A
  • breaking a problem down into smaller tasks so that it is easier to solve
  • each individual problem can be separately tested and solved
  • enables different people to work on the different parts of a larger problem, that can later be recombined to produce a full solution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

2.1.2 Designing, creating and refining algorithms

What is an algorithm?

A
  • a set of instructions, presented in a logical sequence
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

2.1.2 Designing, creating and refining algorithms

Why do programmers create algorithm design?

A
  • a method of planning a program before writing a code
  • considers potential problems of the program
  • makes it easier to start creater source code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

2.1.2 Designing, creating and refining algorithms

What commands does selection use?

A
  • if
  • then
  • else
  • endif

eg:

if firstname == “Steven” then
print(“Hello” + firstname)
elif firstname == “Steve” then
print(“Please use full name”)
else
print(“Who are you?”)
end if

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

2.1.2 Designing, creating and refining algorithms

What commands does iteration use?

with examples

A
  • for loop (for, to, step, next)
  • while loop (while, endwhile)
  • do while loop (do, until)

Iteration (for loop):
for i = 1 to 10 step 1
input item
next i

Iteration (while loop):
while firstname != “Steven”
firstname = input(“Try again:”)
endwhile

Iteration (do while loop):
do
firstname = input(“Guess name:”)
until firstname == “Steven”

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

2.1.2 Designing, creating and refining algorithms

Flowchart symbols

A
  • start/stop - rectangle with rounded corners
  • operation/process - rectangle
  • decision (if statement) - diamond
  • input/output - parallelogram
  • subroutine - rectangle with 2 vertical lines
  • direction of flow - arrow
How well did you know this?
1
Not at all
2
3
4
5
Perfectly