B Algorithmic Design Document
B Algorithmic Design Document
This document contains an interactive checklist. To mark an item as complete, click on the box (the entire
list will be highlighted), then right click (the clicked box will only be highlighted), and choose the
checkmark.
Planning your program before you start coding is part of the development process. In this
document you will:
1. zyBooks
Add your zyBooks screenshots for the % and assigned zyLabs completions below. Required
percentages: all assigned zyLabs, Challenge Activity with at least 70%, and Participation
Activity with at least 80%.
1
2. Program Description
In the box below, describe the purpose of the program. You must include a detailed description
with at least two complete sentences.
Program description:
3. Sample Run
If you are designing your own program, you will start with a sample run. Imagine a user is
running your program - what will they see? What inputs do you expect, and what will be the
outputs from the given inputs? Choose test data you will use to test your program. Calculate
and show the expected outputs. Use the sample run to test your program.
Sample run:
4. Algorithmic Design
Before you begin coding, you must first plan out the logic and think about what data you will
use to test your program for correctness. All programmers plan before coding - this saves a lot
of time and frustration! Use the steps below to identify the inputs and outputs, calculations, and
steps needed to solve the problem.
Use the pseudocode syntax shown in the document, supplemented with English phrases if
necessary. Do not include any implementation details (e.g. source code file names, class
or struct definitions, or language syntax). Do not include any C++ specific syntax or data
types.
Algorithmic design:
a. Identify and list all of the user input and their data types. Include a variable name, data
type, and description. Data types include string, integer, floating point, (single) character,
and boolean. Data structures should be referenced by name, e.g. “array of integer” or
“array of string (for CS161B and up).
2
b. Identify and list all of the user output and their data types. Include a variable name, data
type, and description. Data types include string, integer, floating point, (single) character,
and boolean. Data structures should be referenced by name, e.g. “array of integer” or
“array of string” (for CS161B and up).
c. What calculations do you need to do to transform inputs into outputs? List all formulas
needed, if applicable. If there are no calculations needed, state there are no calculations
for this algorithm. Formulae should reference the variable names from step a and step b
as applicable.
d. Design the logic of your program using pseudocode or flowcharts. Here is where you
would use conditionals, loops or functions (if applicable) and list the steps in transforming
inputs into outputs. Walk through your logic steps with the test data from the assignment
document or the sample run above.
Use the syntax shown at the bottom of this document and plain English phrases.
Do not include any implementation details (e.g. file names) or C++ specific syntax.
5. Pseudocode Syntax
Think about each step in your algorithm as an action and use the verbs below:
3
Update the contents of a SET SET num_dogs = num_dogs + 1
variable
Conditionals
Loops
Functions
4
Create a function FUNCTION return_type name FUNCTION Integer add(Integer
(parameters) num1, Integer num2)
statement DECLARE Integer sum
statement SET sum = num1 + num2
END FUNCTION
RETURN sum
END FUNCTION