0% found this document useful (0 votes)
63 views

Algorithm Template 5 Modules With Structure Chart

This document provides guidelines and requirements for completing algorithm assignments, including pseudocode algorithms. It specifies that assignments must identify inputs, processing, outputs, temporary variables, include a structure chart, pseudocode with line numbering, algorithm and module descriptions, and desk checks. Sub-algorithms should be defined before the main algorithm and numbered consecutively. Each part of the algorithm like inputs, outputs, processing steps, and modules must be clearly specified.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Algorithm Template 5 Modules With Structure Chart

This document provides guidelines and requirements for completing algorithm assignments, including pseudocode algorithms. It specifies that assignments must identify inputs, processing, outputs, temporary variables, include a structure chart, pseudocode with line numbering, algorithm and module descriptions, and desk checks. Sub-algorithms should be defined before the main algorithm and numbered consecutively. Each part of the algorithm like inputs, outputs, processing steps, and modules must be clearly specified.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Algorithm Template 5 Your Name Here

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

{Inputs. variableName: data type}


{Temporary. variableName: data type (used internally, neither input nor output)}
{Outputs. variableName: data type (if an input is also an output,also list it here!)}
Processing
{list the steps here, after the variables}

Structure Chart Main

Get data Process data Process data Output data


{be specific!} {be specific!} {be specific!} {be specific!}

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/}

11 Function Name (list of input variables)


{Name should not contain spaces, just like a variable name!}
returns – {Data Type}
Narrative Description: {In English, describe what the module does, NOT a relisting of the
processing steps.}

local variables: {list each local variable and its data type}

Pseudocode {for the function}


12
13
… {each line should be numbered}
15 Return(variable) {end of function that returns a variable}

16 Procedure Name (list of input variables)


{Name should not contain spaces, just like a variable name!}
Narrative Description: {In English, describe what the module does, NOT a relisting of the
processing steps.}

local variables: {list each local variable and its data type}

Pseudocode {for the procedure}


17
18
19
… {each line should be numbered, consecutively from any previous module}
22 Return( ) {end of procedure}

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}

Line variable variable variableName variable Input/Output


Number Name Name Name
1 (main)
2
3 (function
call in main)
11(function)
… {show the math if the value is
determined by calculation}
15 (function
Return)
3 (function
returns
value to
main)

8
(procedure
call in main)
16
(procedure)

22
(procedure
Return)
8
(procedure
returns
control to
main)

10 (end of
main)

{End of algorithm assignment}

You might also like