Overview
This lecture covers the basics of sequential flowchart and pseudocode design, focusing on common symbols, input/output syntax, and step-by-step algorithm creation through sample problems.
Flowchart Symbols and Syntax
- Terminal symbol indicates start or end of the flowchart.
- Input/output symbol shows where data is entered or displayed.
- Direction flow lines connect each step to show process order.
Input and Output Syntax in Pseudocode
- Output syntax options:
display
for outputs; use double quotes for prompting strings.
- Output values can be displayed directly or with a string and variable (e.g.,
display "Result: ", variable
).
- Input single value:
accept variable
.
- Input multiple values:
accept var1, var2, var3
or multiple single accept
statements.
Example 1: Perimeter and Area of a Rectangle
- Identify input: length and width.
- Output: perimeter and area.
- Perimeter formula:
perimeter = 2 * (length + width)
.
- Area formula:
area = length * width
.
- Pseudocode: declare variables, accept input, calculate values, display results.
- Flowchart uses IPO (Input-Process-Output) structure.
Example 2: Celsius to Fahrenheit Conversion
- Input: temperature in Celsius.
- Output: temperature in Fahrenheit.
- Formula:
Fahrenheit = (9 / 5) * Celsius + 32
.
- Emphasize correct arithmetic order in formula usage.
Key Terms & Definitions
- Terminal Symbol — Shape in a flowchart showing start or end points.
- Input/Output Symbol — Flowchart component for entering or displaying data.
- IPO Structure — Sequence of Input, Process, and Output in problem-solving.
- Pseudocode — Step-by-step written outline of an algorithm using plain language.
- Accept — Pseudocode command to receive input values.
- Display — Pseudocode command to show output values.
Action Items / Next Steps
- Practice making flowcharts and pseudocode for simple arithmetic problems.
- Review proper use of arithmetic expressions in formulas.
- Complete any assigned exercises on flowchart and pseudocode creation.