A construct is a method of controlling the order which the statements in an algorithm are executed.
A sequence is code is executed in the order that it is written.
A selection is code that follows a different sequence based on what condition is chosen.
Iteration is code that repeats a certain sequence a number of times depending on certain conditions.
Top-down design is a way of deigning a computer program by breaking down the problem into smaller problems (subsystems) until it is sufficiently defined to allow it to be understood and programmed.
An algorithm is a process or set of rules to be followed during the execution of a program.
Oval type shape = Terminator, the START or STOP of a system.
Parallelogram shape = Input or output
Rectangle shape = Process
Arrow = Logic flow, joins two operations, the arrowhead indicates the direction of the flow.
Diamond shape = Decision, a point in the sequence where alternative paths can be taken.
A condition is the the criteria that are tested as part of the execution of the code. The condition will result in either a True or False answer when tested.
A high-level process is something like ’Calculate time to complete journey’, for example.
A well-defined process is something like, ‘Arrival Time <- Start Time + Journey Time’, for example. There is little ambiguity about how to complete the process.
Pseudocode is a way of unambiguoulsy representing the sequence and logic of a program using both natural language and code-like statements.
Programmers make use of three instructs when writing code: Sequence, the logical order in which the code is executed. Selection, branching of code onto different paths based on certain conditions. Iteration, repeating of sections of code.
Before coding a program it is crucial to design an appropriate algorithm using either a flowchart or pseudocode.
Flowcharts use a series of symbols to visually represent the logic of a program. The flow of the execution of the program is represented by flow lines with arrow heads to show the direction of flow. It is crucial that the correct symbols are used.
Flowchart design can be done in two stages: The first strange is to consider the logic steps and processes required for the algorithm. The next step is to consider how those steps could be achieved and ensure the flowchart contains enough detail to fully describe each step.
Decision symbols in flowcharts need to include precisely defined mathematical conditions. These should be defined using appropriate mathematical symbols such as > or <, for example, use A < B rather than A is less than B.
Pseudocode is a method of describing the logic of a program by using written language. The language used includes a series of key words that describe the exact programming constructs used in the program.
It is important that you comment your pseudocode (using the // symbol) to help explain the logic of your algorithm.