Chapter 1 Flashcards

1
Q

What is an algorithm

A

A step by step procedure, that computers and humans can follow, to solve problems.

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

List 3 ways to express algorithms:

A

List algorithm
Flow diagram
Pseudocode

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

What is an iteration instruction?

A

Repeating something a set number of times or until a condition is met

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

What is a selection instruction

A

A choice or a decision.

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

What is a sequence instruction?

A

A basic instruction

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

What makes a successful algorithm?

A

Accuracy - how successfully it solves the problem
Efficiency - how quickly it solves the problem

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

What shapes are in the flow diagram

A

Oval
Rectangle
Parallelogram
Diamond

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

Which shape does start/end require?

A

Oval

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

What shape does a simple sequence instruction require?

A

Rectangle

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

What shape does a user input or output require

A

Parallelogram

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

What shape does a selection statement require?(yes or no)

A

Diamond

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

5 rules of naming variable identifiers:

A

1) Must not contain spaces or begin with a number
2) Must be descriptive of its use
3) must be snake_case or camelCase
4) Can’t be too long
5) Cannot be a keyword

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

What is Pseudocode

A

A language that is similar to to a real programming language, but it is easier for humans to understand.
Used to plan your script before coding for real.

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

What is an operator?

A

The symbols that tell the computer what to do

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

What is an operand?

A

The data the operator works on

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

Arithmetic operators…

A

+ - * / // % **

17
Q

What is DIV

A

Divide a number by another ignoring decimals.

// in python. E.g 5//2 = 2

18
Q

What is MOD

A

The remainder of a division

% in python E.g. 5%2 = 1

19
Q

Relational operators…

A

== != < > <= >=

20
Q

Boolean logic operators….

A

And
Or
Not(!=)