Table of Contents

    Assignment - Class 8 - Algorithm & Flowchart

    Assignment - Class 8 - Algorithm & Flowchart
    Figure: Assignment - Class 8 - Algorithm & Flowchart

    ASSIGNMENT — CLASS 8

    Assignment — Algorithm & Flowchart (With Solutions)

    Think, Plan, Solve — Master Problem Solving! This complete assignment covers algorithms and flowcharts — with theory questions, algorithm writing tasks, and flowchart drawing exercises. Complete all three sections and aim for 100 marks!

    Assignment Overview

    Assignment Details:
    • Total Marks: 100
    • Section A (Theory): 30 marks
    • Section B (Algorithms): 40 marks
    • Section C (Flowcharts): 30 marks
    • Duration: 1 week

    Motivational Message

    Algorithms are like recipes — step-by-step instructions to achieve a result. Flowcharts are like maps that show the path visually. Master them, and programming becomes easy!

    What is an Algorithm?

    An algorithm is a step-by-step procedure to solve a problem in a finite number of steps.

    ALGORITHM FLOW
    ProblemStepsSolution

    Objectives

    Learning Goals

    • ✅ Understand algorithms.
    • ✅ Learn flowchart symbols.
    • ✅ Write step-by-step procedures.
    • ✅ Draw flowcharts.
    • ✅ Solve problems logically.
    • ✅ Practice sequence & selection structures.

    Section A: Theory Questions (30 Marks)

    Q1. What is an algorithm? Give one example. (6 marks)

    Answer

    An algorithm is a step-by-step procedure to solve a problem in a finite number of well-defined steps.

    Example: Algorithm to make tea:

    1. Start
    2. Boil water
    3. Add tea leaves
    4. Add sugar and milk
    5. Stir well
    6. Pour in cup
    7. Stop

    Q2. Name any five characteristics of a good algorithm. (6 marks)

    Answer
    1. Finiteness: Must have a finite number of steps.
    2. Definiteness: Each step must be clear and unambiguous.
    3. Input: Should have zero or more inputs.
    4. Output: Should produce at least one output.
    5. Effectiveness: Each step should be simple and doable.
    6. Correctness: Should give the correct result.
    7. Generality: Should work for all valid inputs.

    Q3. What is a flowchart? List any 4 flowchart symbols with their uses. (6 marks)

    Answer

    A flowchart is a graphical representation of an algorithm using standard symbols and arrows to show the flow of steps.

    Symbol Name Use
    Oval Terminator Start / Stop
    Parallelogram Input/Output Read data / Display result
    Rectangle Process Calculations, assignments
    Diamond Decision Yes/No conditions
    Arrow Flow Line Direction of flow

    Q4. Explain sequence and selection structure with examples. (6 marks)

    Answer

    1. Sequence Structure:

    In sequence structure, statements are executed one after another in the given order. No decisions or repetitions.

    Example:

    1. Start
    2. Read A and B
    3. SUM = A + B
    4. Print SUM
    5. Stop

    2. Selection Structure:

    In selection structure, the program chooses one of two or more paths based on a condition. Uses if-else logic.

    Example:

    1. Start
    2. Read marks
    3. If marks >= 40 then print "Pass"
    4. Else print "Fail"
    5. Stop

    Q5. Write the difference between algorithm and flowchart. (6 marks)

    Answer
    Aspect Algorithm Flowchart
    Form Written in text/words Drawn using symbols
    Format Step-by-step text Graphical / Diagram
    Symbols No symbols used Standard symbols used
    Complexity Easy to write Takes more time to draw
    Readability Good for programmers Easy for anyone to understand
    Example Text steps Boxes and arrows

    Section B: Algorithm Writing (40 Marks)

    Algo 1: Sum of Two Numbers (8 marks)

    Step 1: Start
    Step 2: Read two numbers A and B
    Step 3: Calculate SUM = A + B
    Step 4: Display SUM
    Step 5: Stop
    Test Case Input: A = 5, B = 3 → Output: SUM = 8

    Algo 2: Check Even or Odd (8 marks)

    Step 1: Start
    Step 2: Read number N
    Step 3: Calculate R = N % 2 (remainder)
    Step 4: If R == 0 then
                Print "Even"
            Else
                Print "Odd"
    Step 5: Stop
    Test Cases
    • Input: N = 4 → Output: Even
    • Input: N = 7 → Output: Odd

    Algo 3: Largest of Three Numbers (8 marks)

    Step 1: Start
    Step 2: Read three numbers A, B, and C
    Step 3: If A >= B AND A >= C then
                LARGEST = A
            Else if B >= C then
                LARGEST = B
            Else
                LARGEST = C
    Step 4: Display LARGEST
    Step 5: Stop
    Test Case Input: A = 5, B = 10, C = 3 → Output: LARGEST = 10

    Algo 4: Area of a Rectangle (8 marks)

    Step 1: Start
    Step 2: Read Length L and Breadth B
    Step 3: Calculate AREA = L * B
    Step 4: Display AREA
    Step 5: Stop
    Test Cases
    • Input: L = 5, B = 3 → Output: AREA = 15
    • Input: L = 10, B = 4 → Output: AREA = 40

    Algo 5: Check Pass or Fail (8 marks)

    Step 1: Start
    Step 2: Read marks M
    Step 3: If M >= 40 then
                Print "Pass"
            Else
                Print "Fail"
    Step 4: Stop
    Test Cases
    • Input: M = 55 → Output: Pass
    • Input: M = 30 → Output: Fail
    • Input: M = 40 → Output: Pass (boundary case)

    Section C: Flowchart Drawing (30 Marks)

    Flow 1: Display "Hello World" (10 marks)

    Draw:
    
      ┌────────┐
      │ Start  │  (Oval)
      └───┬────┘
          ↓
      ┌────────────────┐
      │ Display        │  (Parallelogram)
      │ "Hello World"  │
      └───┬────────────┘
          ↓
      ┌────────┐
      │  Stop  │  (Oval)
      └────────┘
    Description Uses 2 ovals (Start, Stop) and 1 parallelogram (Display). Connect with arrows.

    Flow 2: Add Two Numbers (10 marks)

    Draw:
    
      ┌────────┐
      │ Start  │  (Oval)
      └───┬────┘
          ↓
      ┌────────────┐
      │ Read A, B  │  (Parallelogram)
      └───┬────────┘
          ↓
      ┌────────────┐
      │ SUM = A+B  │  (Rectangle)
      └───┬────────┘
          ↓
      ┌────────────┐
      │ Print SUM  │  (Parallelogram)
      └───┬────────┘
          ↓
      ┌────────┐
      │  Stop  │  (Oval)
      └────────┘
    Description Uses 2 ovals, 2 parallelograms (Read, Print), and 1 rectangle (calculation).

    Flow 3: Check Even or Odd (10 marks)

    Draw:
    
      ┌────────┐
      │ Start  │  (Oval)
      └───┬────┘
          ↓
      ┌──────────┐
      │ Read N   │  (Parallelogram)
      └───┬──────┘
          ↓
      ┌────────────┐
      │ R = N % 2  │  (Rectangle)
      └───┬────────┘
          ↓
      ┌────────────┐
      │ Is R == 0? │  (Diamond)
      └──┬──────┬──┘
       Yes    No
        ↓      ↓
      ┌─────┐ ┌─────┐
      │Even │ │ Odd │  (Parallelograms)
      └──┬──┘ └──┬──┘
         └───┬───┘
             ↓
         ┌───────┐
         │ Stop  │  (Oval)
         └───────┘
    Description Uses 2 ovals, 1 parallelogram (Read), 1 rectangle (calculation), 1 diamond (decision), and 2 parallelograms (Print).

    Flowchart Symbols Quick Reference

    Symbol Name Use
    🟢 Oval Terminator Start / Stop
    🔵 Parallelogram Input/Output Read data / Display result
    🟡 Rectangle Process Calculations, assignments
    🔴 Diamond Decision Yes/No, if-else
    ➡️ Arrow Flow Line Direction of flow
    ⭕ Circle Connector Connect flowchart parts

    Submission Format

    How to Submit

    • ✅ Handwritten in notebook OR A4 sheets.
    • ✅ Draw flowcharts with proper symbols.
    • ✅ Use pencil for drawings, pen for text.
    • ✅ Include arrows showing direction.
    • ✅ Clean handwriting and formatting.
    • ✅ Number each step of algorithms.
    • ✅ Submit on time.
    • ✅ Include your name, roll no, class.

    Evaluation Criteria (Total: 100 Marks)

    Section Description Marks
    Section ATheory Questions30
    Section BAlgorithm Writing40
    Section CFlowchart Drawing30
    Total100 Marks

    Tips for Success

    Best Practices

    • 📖 Read questions carefully.
    • 📝 Write clear step-by-step algorithms.
    • 🎨 Use correct flowchart symbols.
    • 📐 Draw neat and labeled flowcharts.
    • 🔢 Number each step.
    • 🧪 Test your logic with sample inputs.
    • ▶️ Always include Start and Stop.
    • ➡️ Use arrows to show flow direction.
    • 💬 Add short comments if needed.
    • ✍️ Practice makes perfect!

    Common Mistakes to Avoid

    Watch Out for These!

    • ❌ Skipping Start / Stop.
    • ❌ Using wrong symbols.
    • ❌ Missing arrows.
    • ❌ Vague steps (not clear).
    • ❌ No decision box for if-else.
    • ❌ Not testing logic.
    • ❌ Overlapping arrows.
    • ❌ Illegible handwriting.

    Did You Know?

    Fun Fact

    The word "Algorithm" comes from Al-Khwarizmi, a Persian mathematician from the 9th century! He is called the Father of Algebra. His name gave rise to the modern word "algorithm".

    Bonus Challenges (Optional)

    Extra Practice

    • 🌟 Algorithm to swap two numbers.
    • 🌟 Flowchart to find factorial of a number.
    • 🌟 Algorithm to check leap year.
    • 🌟 Flowchart to convert Celsius to Fahrenheit.
    • 🌟 Algorithm to calculate simple interest.
    • 🌟 Flowchart to find the smallest of three numbers.
    • 🌟 Algorithm to calculate average of 5 numbers.
    • 🌟 Flowchart to check if a character is vowel or consonant.

    Frequently Asked Questions

    Q1. Can I use pen for flowcharts?

    Pencil is recommended so you can erase mistakes. Use pen for final version.

    Q2. Should I use a ruler?

    Yes, use ruler for straight lines and arrows. Keeps flowchart neat.

    Q3. How big should symbols be?

    Big enough to write text clearly inside. About 3-4 cm wide works well.

    Q4. Can I use a template or flowchart software?

    Ask your teacher. Hand-drawn is usually preferred, but software like Draw.io works too.

    Q5. What if my algorithm has more steps?

    No problem! Use as many steps as needed. Just make each step clear.

    Q6. Should I number the steps?

    Yes! Number each step (Step 1, Step 2...) or use bullet points. Makes it easy to follow.

    Q7. Do I need to write test cases?

    Not required, but showing 2-3 test cases can earn extra marks and demonstrate understanding.

    Q8. What if I make a mistake in the flowchart?

    Erase and redo. Or use whitener. Keep flowchart clean and readable.

    Key Takeaways

    • Complete all 3 sections for full 100 marks.
    • Section A: Theory (30 marks).
    • Section B: 5 algorithms (40 marks).
    • Section C: 3 flowcharts (30 marks).
    • Always include Start and Stop.
    • Use correct flowchart symbols.
    • Number your algorithm steps.
    • Test your logic with examples.
    • Draw neat and labeled diagrams.
    • Practice makes perfect!

    Key Takeaway

    Algorithms and flowcharts help us solve problems step by step! Master them and coding becomes easy!

    This assignment covers all the essential concepts of Chapter 4. Complete it thoroughly and you'll build a strong foundation for programming!

    Think logically. Draw neatly. Solve confidently. You will do great!

    THINK SMART, PLAN CLEAR, SOLVE BETTER!

    Best of Luck! Practice daily, understand deeply, and solve confidently! 👍😊

    Flowchart → Visual Thinking → Smart Solutions → Better Results! 🚀