Algorithm Template 5 Modules With Structure Chart
Algorithm Template 5 Modules With Structure Chart
All pseudocode algorithm assignments require identification of the inputs, processing, outputs, and
temporary variables/constants needed, a structure chart, correct pseudocode, including an algorithm
name and narrative description, and one or more desk checks for full credit. A separate matching,
working Flowgorithm is also required.
The problem statement is given here. Each line is important. Read this carefully for clues as to
what is needed to solve the problem. (Provided by the instructor in the assignment)
{Algorithm answer starts here – Use the algorithm assignment document supplied in Moodle to
provide your solution to the problem. Please do not make your own!}
Defining Diagram
Inputs Temporary Outputs
Process data
{If a module calls another module it is shown below
{be specific!}
the calling module}
{One structure chart for the whole algorithm. Modules are just another box.}
{Define all sub-algorithms BEFORE the main algorithm; this code isn’t executed until it is called
by the mainline algorithm. Therefore, sub-algorithms should be numbered consecutively AFTER
all the mainline pseudocode is numbered; the main algorithm name should always be line 1/}
local variables: {list each local variable and its data type}
local variables: {list each local variable and its data type}
1 Algorithm Name {for the mainline algorithm - with no spaces, just like a variable name}
Narrative Description: {In English, describe what the whole algorithm does, NOT a relisting of
the processing steps.}
Pseudocode {Main or mainline, calls the modules, each line should be numbered, start with the
name of the algorithm as line 1}
2
3
…
10 Halt {End of mainline}
Desk Check {one or more, as necessary}
Inputs: {list input variables with a sample input}
Expected correct output: {list output variables and their expected, correct result}
8
(procedure
call in main)
16
(procedure)
…
22
(procedure
Return)
8
(procedure
returns
control to
main)
…
10 (end of
main)