ECT 100 E2 - reduced


ECT 100: Create Simple Software

  • Course Objective: Analyze simple problems and design solutions using algorithms and flowcharts.

Problem Analysis and Algorithm Writing

  • PC1: Analyze simple problems and write algorithms to solve them.

Understanding Algorithms

  • Definition: Algorithm is a step-by-step procedure to solve a problem.

  • Basic Components:

    • Input: Necessary data to solve the problem.

    • Process: Steps to manipulate or process the input.

    • Output: Desired result or solution.

Example Algorithms

Example 1: Basic Calculation

  • Problem: Calculate the sum of two numbers.

  • Steps:

    1. Identify input → Two numbers (a and b).

    2. Define process → Add the two numbers (sum = a + b).

    3. Identify output → Display the result (sum).

  • Algorithm:

    • Start

    • Read a and b

    • Calculate sum = a + b

    • Display sum

    • End

Example 2: Decision Making

  • Algorithm:

    • Start

    • Read mark

    • If score < 60

      • Yes: display failing

      • No: display passing

    • End

Pseudocode Composition

  • PC2: Compose pseudocode to formulate solutions.

Understanding Pseudocode

  • Definition: Pseudocode is a planning tool for programming, utilizing simple words and clear instructions.

  • Basic Structure:

    • Input/Output: INPUT, OUTPUT

    • Process: Assignment statements (e.g., sum ← a + b)

    • Decision Making: IF-THEN-ELSE

    • Looping: WHILE, FOR

Pseudocode Examples

Example 1: Basic Calculation

  • Pseudocode:

    • START

    • INPUT a, b

    • sum ← a + b

    • OUTPUT sum

    • END

Example 2: Decision Making

  • Problem: Determine if a student's score is passing.

  • Explanation:

    • Input: Marks

    • Process: Check if the grade is passing (>= 60).

    • Output: "Passing" or "Failing".

  • Pseudocode:

    • Start

    • INPUT score

    • IF score < 60 THEN

      • OUTPUT "failing"

    • ELSE

      • OUTPUT "passing"

    • End

Flowchart Diagrams Development

  • PC3: Develop flowchart diagrams to illustrate solutions.

Understanding Flowchart Diagrams

  • Definition: A flowchart is a diagram representing steps using standard shapes and arrows, helping to visualize a problem before coding.

  • Key Symbols: Various standard shapes and their functions to represent different steps in a process.

Example 1: Basic Calculation Flowchart

  • Algorithm Steps:

    • Start

    • Read a and b

    • Calculate sum = a + b

    • Display sum

    • End

Example 2: Decision Making Flowchart

  • Synopsis:

    • Start

    • Read mark

    • If marks < 60

      • Display "failing"

      • Else display "passing"

    • End