RAPTOR Flowchart Exercises Practice on Decision Making, Loops, and Basic Logic RAPTOR is a visual programming tool used to design and trace algorithms using flowcharts. This presentation offers exercises to build logic using RAPTOR’s symbols—Input/Output, Assignment, Decision, and Loop structures. Objective: Strengthen understanding of algorithmic flow before coding in languages like Python or C.
Understanding RAPTOR Basics RAPTOR represents algorithms through symbols: - Oval: Start/End - Parallelogram: Input/Output - Rectangle: Processing/Assignment - Diamond: Decision - Loop Arrow: Repetition Exercise: Draw a simple RAPTOR flowchart to input two numbers and display their sum. Tip: Use Input symbols for A, B; an Assignment for Sum = A + B; and Output to print the result.
Input and Output Exercises Concept: Using Input and Output symbols correctly forms the basis of every flowchart. Example: Input name and display “Hello <name>”. Exercise: Create a RAPTOR flowchart that takes user age and prints: - “Minor” if age < 18 - “Adult” otherwise. Hint: Use a Decision diamond for the condition.
Decision Structure (IF-THEN-ELSE) Concept: The decision diamond allows branching. Example: Input a number N and check if it is even or odd. Exercise: Design a flowchart to input marks and display: - “Pass” if marks ≥ 40 - “Fail” otherwise. Extension: Add “Distinction” for marks ≥ 75. Key Idea: Conditions are checked sequentially.
Nested Decision Example Concept: Decisions can be nested to handle multiple outcomes. Example: Input temperature and print “Cold”, “Warm”, or “Hot”. Exercise: Create a RAPTOR flowchart to determine the largest of three numbers A, B, and C. Hint: Use nested IFs or multiple diamonds.
Looping Structures (WHILE Loop) Concept: Loops help repeat operations until a condition becomes false. Example: Print numbers from 1 to 5 using a WHILE loop. Exercise: Write a RAPTOR flowchart that prints the sum of first 10 natural numbers. Hint: Use a counter variable initialized to 1, add to SUM, and increment until counter > 10.
FOR Loop Practice Concept: FOR loops simplify counting operations. Example: Display the square of numbers 1 to 5. Exercise: Create a RAPTOR flowchart using a FOR loop to calculate the factorial of a number N. Key Tip: Initialize result = 1 and multiply by loop variable each iteration.
Arrays in RAPTOR Concept: Arrays store multiple values under one name. Example: Input 5 numbers into array A and find their sum. Exercise: Design a flowchart that takes marks of 5 students and prints the average. Hint: Use loop + array index variable.
Complex Exercise – Nested Loops Concept: Nested loops help process multi-level data. Example: Generate a multiplication table (1 to 5). Exercise: Design a RAPTOR flowchart to print a pattern: * ** *** **** Hint: Use nested loops (outer loop for rows, inner for stars).
Summary & Practice Challenge Summary: You learned to use input/output, decisions, loops, and arrays in RAPTOR. Challenge Exercise: Create a RAPTOR flowchart that: 1. Inputs 5 numbers 2. Finds the maximum, minimum, and average 3. Displays all three results Next Step: Trace the flow manually to verify correctness.