Resources | Subject Notes | Computer Science
To learn how to draw a flowchart based on a given set of pseudo-code instructions.
A flowchart is a diagram that illustrates the steps involved in solving a problem. It uses standard symbols to represent different types of operations and the flow of control.
Symbol | Description |
---|---|
Start/End | Oval - Indicates the beginning and end of the algorithm. |
Process | Rectangle - Represents a step or operation. |
Decision | Diamond - Represents a point where a decision is made. |
Input/Output | Parallelogram - Represents input or output operations. |
Connector | Circle - Used to connect different parts of the flowchart. |
Predefined Process | Rectangle with double lines - Represents a sub-routine or predefined process. |
Consider the following pseudo-code algorithm to calculate the area of a rectangle:
START INPUT length, width IF length > 0 AND width > 0 THEN area = length * width OUTPUT area ELSE OUTPUT "Invalid input: Length and width must be positive." ENDIF END
Here's the flowchart representation of the above pseudo-code:
If Yes:
If No:
The flowchart visually represents the flow of control in the algorithm. It shows the input steps, the decision point, the calculation process, and the output steps. The connectors indicate the flow of execution.