Draw This - beginner
Draw a flowchart to check if a number is positive, negative, or zero. Use the number 7 as input.
5 minutes
Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Draw a flowchart to check if a number is positive, negative, or zero. Use the number 7 as input.
_______
/ Start \
\_______/
|
v
_____________
| Input number |
| (7) |
-------------
|
v
______________________
| Is number > 0? (7>0) |
----------------------
/ \
Yes No
/ \
v v
_______ ______________________
|Print | | Is number < 0? (7<0) |
|"Pos" | ----------------------
|_______| / \
| Yes No
| / \
v v v
_______ _______ _______
| End | |Print | |Print |
| | |"Neg" | |"Zero" |
|______| |_______| |_______|
| |
v v
_______ _______
| End | | End |
| | | |
|______| |______|1. Start the flowchart with a Start symbol.
2. Input the number (7 in this case).
3. Check if the number is greater than zero using a decision diamond.
4. If yes, print "Pos" and end.
5. If no, check if the number is less than zero.
6. If yes, print "Neg" and end.
7. If no, it means the number is zero, so print "Zero" and end.
This flowchart clearly shows the logic to classify a number as positive, negative, or zero.