Chapter 11 Algorithms Design and Problem-solving Flashcards
What is an algorithm?
An algorithm is a sequence of steps that can be carried out to perform a task
Say an example of an algorithm.
A receipt for cooking would be a good example because it show a set of steps to perform.
Which are the three ways in which an algorithm can be expressed?
Structured English
Pseudocode
Flowchart
What is Structured English?
Structured English is a subset of the English language that consists of command statements used to describe an algorithm
What is Pseudocode?
Pseudocode is a way of using keywords and identifiers to describe an algorithm without following the syntax of a particular programming language
What is Flowchart?
Flowchart is shapes linked together to represent the sequential steps of an algorithm
What are variables?
Variables are a storage locations for a data value that has an identifier
What is an important aspect of an identifier?
An identifier must not have space in it.
How do you Swap the value 15 and 34 in variables?
We will make a temporary variable
Tempvariable
to which we will copy 15 to and than copy 34 to the variable where 15 was. Afterwards, we copy 15 to where 34 was initially.
What is an Identifier Table?
An identifier table is a table listing the variable identifiers required for the solution, with explanations.
Which are the relational operators?
= Is equal to < Is less than > Is greater than <= Is less than or equal to >= Is greater than or equal to <> Is not equal to
What does Nested IF statement mean?
Nested IF statement means a conditional statement within a conditional statement.
What is a nested loop?
A nested loop is a loop containing another loop.