0
0
Intro to Computingfundamentals~10 mins

Search and find operations in Intro to Computing - Draw & Build Visually

Choose your learning style9 modes available
Draw This - beginner

Draw a flowchart to search for a number 7 in the list: [3, 5, 7, 9, 11]. Show each step of checking elements until the number is found or the list ends.

7 minutes
Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Grading Criteria
Start and End symbols present
Initialization of index variable shown
Decision diamond for index < list length present
Decision diamond for element == 7 present
Correct loop back to index check
Outputs 'Found' or 'Not Found' correctly
Solution
  +-------+
  | Start |
  +-------+
      |
      v
  +-----------------+
  | Set index = 0   |
  +-----------------+
      |
      v
  +-----------------------------+
  | Is index < length of list?  |----No----->+------------+
  +-----------------------------+            | Not Found  |
      |Yes                                      +------------+
      v
  +-----------------------------+
  | Is list[index] == 7?        |----Yes----->+---------+
  +-----------------------------+              | Found   |
      |No                                       +---------+
      v
  +-----------------+
  | index = index+1 |
  +-----------------+
      |
      v
  (loop back to check index < length)

This flowchart starts by setting an index to 0, which points to the first element in the list.

It checks if the index is still within the list length. If not, it means the number 7 was not found, so it ends with 'Not Found'.

If the index is valid, it compares the current element with 7. If they match, it ends with 'Found'.

If not, it increases the index by 1 and repeats the check until it finds 7 or reaches the end.

Variations - 2 Challenges
[beginner] Draw a flowchart to search for the number 10 in the list: [2, 4, 6, 8, 10, 12]. Show each step until found or list ends.
[intermediate] Draw a flowchart to search for a word 'apple' in the list: ['banana', 'apple', 'cherry', 'date']. Show each step until found or list ends.