Chapter 1 - Algorithms Flashcards

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
Q

What are 6 rules for identifiers?

A

-No spaces
-not start with number
-descriptive
-not too long
-not a keyword
-Camel-Case or Snake-Case

26
Q

What is pseudo-code?

A

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
Q

What is an operand?

A

The data the operators work on

28
Q

What is the operator?

A

The symbol that tells the computer what to do

29
Q

What does + do?

A

Adds 2 numbers together

30
Q

What does - do?

A

Subtracts 1 number from another

31
Q

What does * do?

A

Multiplies 2 numbers together

32
Q

What does / do?

A

Quotient - divide 1 number by another with decimal

33
Q

What does // or DIV mean?

A

Quotient - divide 1 number by another ignoring decimal

34
Q

What does MOD or % mean?

A

Modulus - the remainder when 1 number is divided by another

35
Q

What does ^ or ** mean?

A

Power - 1 number to the power of another

36
Q

What does = or == mean?

A

Checks to see if one operand is the same as another

37
Q

What does != mean?

A

Checks to see if one operand is not the same as another

38
Q

What does < mean

A

Checks to see if one operand is less than another.

39
Q

What does > mean?

A

Checks to see if one operand is greater than another.

40
Q

What does <= mean

A

Checks to see if one operand is less than or equal to another

41
Q

What does >= mean?

A

Checks to see if one operand is greater than or equal to another

42
Q

What does AND mean?

A

Checks to see if the first condition statement AND the second is true

43
Q

What does or mean?

A

Checks to see if the first condition statement or second is true

44
Q

What does Not or != mean?

A

Checks to see if a condition statement is NOT true

45
Q

Give an example of relational operators

A
  • = ==
  • !=
  • <
  • >
  • <=
  • > =
46
Q

Give an example of Boolean logic operators are

A
  • AND
  • or
  • not
47
Q

Give an example of Arithmetic operators

A
  • +
  • -
  • *
  • /
  • DIV //
  • MOD %
  • ^ **