📊

Flowchart Fundamentals and Examples

Sep 5, 2024

CC 101 Lecture Notes: Flowcharts

Introduction

  • Subject: CC 101
  • Previous Topics: Control Structures, Sequence, Repetition, Decision Making
  • Current Topic: Flowcharts

What is a Flowchart?

  • A visual representation of algorithms.
  • Uses symbols to show step-by-step processes for problem-solving.

Tools for Creating Flowcharts

  • Suggested tool: Lucidchart.
  • Alternative: Pen and paper if software is not available.
  • Steps to use Lucidchart:
    • Sign up with Google account.
    • Click "New" to start a new flowchart.

Basic Flowchart Symbols

  1. Terminator (Ellipse)

    • Denotes the beginning and end of a flowchart.
  2. Preparation (Parallelogram)

    • Used for declaring and assigning variables/constants.
  3. Decision (Diamond)

    • Represents branching (if-else statements).
  4. Process (Rectangle)

    • Used for processing data and assigning values.
  5. Flow Lines

    • Indicates the direction of the flow (arrows).
  6. Connectors

    • Used to connect flowcharts across pages or screens.

Example Flowcharts

Example 1: Hello World

  • Objective: Create a flowchart to display "Hello, World!"
  • Steps:
    1. Start (Use Terminator)
    2. Output "Hello, World!"
    3. End

Example 2: Display Name and Age

  • Objective: Flowchart to display a name and age.
  • Example output:
    • Name: Gel Conan
    • Age: 25
  • Steps:
    1. Start
    2. Declare variables (name, age)
    3. Output name and age
    4. End

Example 3: Age Evaluation

  • Objective: Determine if a user is a minor or legal age.
  • Steps:
    1. Start
    2. Input age
    3. Decision: Age <= 17?
    • Yes: Output "You are a minor"
    • No: Output "You are of legal age"
    1. End

Example 4: Sum of Two Numbers

  • Objective: Compute the sum of two user input numbers.
  • Steps:
    1. Start
    2. Input first number
    3. Input second number
    4. Compute sum
    5. Output sum
    6. End

Conclusion

  • Recap of flowchart basics and examples.
  • Reminder to practice creating flowcharts for better understanding.
  • Next live online discussion for further clarification.