Week 5- DESIGNING AND IMPLEMENTING BASIC ALGORITHMS WTH JAVASCRIPT Flashcards

1
Q

What is an algorithm?

A

An algorithm is a finite sequence of unambiguous and executable operations that has one starting point and that
ends.

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

What are the characteristics that define a set of instructions as an algorithm?

A
Unambiguous
Finite 
Sequence
Executable
One starting point
Ends
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the names of the three algorithmic structures?

A

Sequence
Selection
Iteration

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

What is meant by the term ‘nesting’ in the context of algorithmic structures?

A

Placing one object or structure completely inside another. In the context of programming and the structured program theorem, nesting allows for any statement inside an algorithmic structure to be replaced by another complete algorithmic structure.

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

What is Pseudocode?

A

Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm. Can be a mix of code and normal English.

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

Why is Pseudocode used?

A

The purpose of using pseudocode is that it is easier for people to understand than conventional programming language code, and that it is an efficient and environment-independent description of the key principles of an algorithm.

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

What are some of the common guidelines for writing pseudocode?

A
  1. Mimic good code and good English
  2. Ignore unnecessary details
  3. Don’t belabour the obvious.
  4. Take advantage of programming shorthands.
  5. Consider the context
  6. Don’t lose sight of the underlying model.
  7. Check for balance.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are four general categories that can be used as the basis for gathering information about an algorithm?

A

The four categories are interface, processes, rules and error handling.

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

What are validation rules?

A

Validation rules define what data values are useable and valid (and therefore also the data values that are not useable and are invalid).

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

What are business rules?

A

A business rule is typically a statement of a how a decision should be made under a given set of circumstances.

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

What is error handling?

A

Error handling is about what the algorithm should do if it detects errors, and the existence of validation rules implies that errors are possible.

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

What is the top down design approach?

A

An added strategy that you can use within this iterative process is known as top-down design. This approach is essentially about breaking down the description of an algorithm from an initial generalised version into subsequent versions of increasing detail.

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

What are the three criteria that can be used to decide if a statement in an algortihm is ‘acceptable’?

A

Each statement should be clear, unambiguous and performable

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

What are two important reasons for testing an algorithm?

A

1) If the working draft of three algorithm that is currently available performs correctly.
2) If the final and completed algorithm performs correctly.

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