Chapter 1 - Algorithms Flashcards

(47 cards)

1
Q

What is an algorithm?

A

A step by step procedure for solving problems

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

What is a list algorithm?

A

Instructions written in order

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

What is an iteration

A

Repeating something a set number of tines 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?

A

A choice or decision

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

What is a sequence?

A

A basic instruction

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

Is “tip 4 large eggs whites into a mixing bowl” a sequence iteration or selection?

A

Sequence because it is a basic instruction

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

Is “ keep beating until mixture stands up in stiff peaks” a sequence iteration or selection?

A

Selection and iteration because its a decision and is repeating until condition met

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

What is correctness?

A

How successful it solves the problem

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

What is efficiency?

A

How quickly it solves the problem

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

What is a flow diagram?

A

Instructions that are written in boxes connected with arrows and pseudo code, where the programmer prepares to write the final script in a code-like language.

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

What shape is start and end boxes?

A

An oval

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

What shape is the simple sequence instruction?

A

A rectangle

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

What shape is a user inputs and outputs in a flow diagram?

A

Rhombus

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

What shape is selections?

A

Diamond

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

Selections have what two options

A

Yes and no

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

An algorithm diagram is also called what?

A

Flow diagrams

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

What is a selection statement?

A

A decision is made, leading to one of 2 alternative actions

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

What is a process

A

The action that is taken as a result of a decision

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

What does authenticate mean?

A

Confirms that a users username and password match the data stored on record

20
Q

What is a variable?

A

A container which is used to store data, e.g. numbers or text

21
Q

What is a constant?

A

Data that does not change throughout the script

22
Q

Example of camel-case?

A

boyAge
girlHeight

23
Q

Example of Snake-Case

A

Boy_age
Girl_height

24
Q

What are 2 variable identifiers?

A

Snake-case
Camel-case

25
What are 6 rules for identifiers?
-No spaces -not start with number -descriptive -not too long -not a keyword -Camel-Case or Snake-Case
26
What is pseudo-code?
A language that is similar to a real programming language but is easier to understand. It allows you o plan your script and get the layout and structure right, before coding it for real.
27
What is an operand?
The data the operators work on
28
What is the operator?
The symbol that tells the computer what to do
29
What does + do?
Adds 2 numbers together
30
What does - do?
Subtracts 1 number from another
31
What does * do?
Multiplies 2 numbers together
32
What does / do?
Quotient - divide 1 number by another with decimal
33
What does // or DIV mean?
Quotient - divide 1 number by another ignoring decimal
34
What does MOD or % mean?
Modulus - the remainder when 1 number is divided by another
35
What does ^ or ** mean?
Power - 1 number to the power of another
36
What does = or == mean?
Checks to see if one operand is the same as another
37
What does != mean?
Checks to see if one operand is not the same as another
38
What does < mean
Checks to see if one operand is less than another.
39
What does > mean?
Checks to see if one operand is greater than another.
40
What does <= mean
Checks to see if one operand is less than or equal to another
41
What does >= mean?
Checks to see if one operand is greater than or equal to another
42
What does AND mean?
Checks to see if the first condition statement AND the second is true
43
What does or mean?
Checks to see if the first condition statement or second is true
44
What does Not or != mean?
Checks to see if a condition statement is NOT true
45
Give an example of relational operators
- = == - != - < - > - <= - >=
46
Give an example of Boolean logic operators are
- AND - or - not
47
Give an example of Arithmetic operators
- + - - - * - / - DIV // - MOD % - ^ **