Draw This - beginner
Draw a flowchart to plan an algorithm that finds the largest of three numbers: A=15, B=23, C=8.
10 minutes
Hint 1
Hint 2
Hint 3
Hint 4
Draw a flowchart to plan an algorithm that finds the largest of three numbers: A=15, B=23, C=8.
+-------+
| Start |
+-------+
|
v
+---------------------+
| Input A=15, B=23, C=8 |
+---------------------+
|
v
+-----------------+
| Is A > B? |<-------------------+
+-----------------+ |
/ \ |
Yes No |
/ \ |
v v |
+---------+ +---------+ |
| Max=A | | Max=B | |
+---------+ +---------+ |
| | |
+----------+---------------------+
|
v
+-----------------+
| Is C > Max? |<----------------+
+-----------------+ |
/ \ |
Yes No |
/ \ |
v v |
+---------+ +---------+ |
| Max=C | | Max=Max | |
+---------+ +---------+ |
| | |
+----------+----------------------+
|
v
+--------------+
| Display Max |
+--------------+
|
v
+-------+
| End |
+-------+
This flowchart starts by taking three numbers A=15, B=23, and C=8 as input.
First, it compares A and B using a decision diamond. If A is greater than B, it sets Max to A; otherwise, Max is set to B.
Next, it compares C with the current Max. If C is greater, Max is updated to C; otherwise, Max remains the same.
Finally, the flowchart displays the largest number stored in Max and ends.
This step-by-step comparison ensures the largest of the three numbers is found correctly.