03-Unit2-CS 1 – FLOWCHART
03-Unit2-CS 1 – FLOWCHART
Flowcharting is a visual
representation of an algorithm
or a process, and it's not specific
to any programming language,
including Java.
Flowcharts use standardized
symbols to represent various
actions, decisions, loops, and
processes within a program.
Flowcharts can help you plan and
visualize the logic of your program
before you start coding. Once you
have a flowchart, you can then
translate it into Java code.
Here's a basic guide on how to
create a flowchart for a Java
program:
1. Understand the Problem:
Before you start creating a
flowchart, you should have a clear
understanding of the problem
you're trying to solve with your
Java program.
2. Identify Inputs and Outputs:
Determine what data your
program will take as input and
what it should produce as output.
3. Start/End Symbols: A
flowchart typically begins with a
"Start" symbol and ends with an
"End" symbol.
4. Process Symbols: Use
rectangular boxes to represent
processes or actions in your
program. Each box should
describe what operation is being
performed.
5. Decision Symbols: Use diamond-
shaped symbols to represent
decision points in your program
where you have to make a choice
based on a condition (e.g., if-else
statements).
6. Input/Output Symbols: Use
parallelogram-shaped symbols to
represent input and output
operations (e.g., reading data from
the user or displaying results).
7. Arrows and Flowlines: Use
arrows or flowlines to connect
the symbols and show the flow
of control in your program.
8. Annotations and Comments:
Add comments or annotations to
explain complex logic or provide
additional information.
FLOWCHART
SYMBOLS
Start/End Symbol or
Terminal
•The terminator symbol marks
the starting or ending point of
the system. It usually
contains the word "Start" or
"End."
Process Symbol
•A box can represent a
single step ("add two cups
of flour"), or an entire sub-
process ("make bread")
within a larger process.
Input/Output Symbol
(I/O)
•Represents material or
information entering or
leaving the system, such
as customer order (input)
or a product (output).
Decision Symbol
•A decision or branching
point. Lines representing
different decisions
emerge from different
points of the diamond.
Flowline Symbol:
Shows the process’
direction. Each flowline
connects two blocks.
Annotation / Comment
Symbol:
Indicates additional
information regarding a step
in a process.
Start
Input A
Input B
Get the sum of A and B
Display sum
End
Start
Read A and B
If A > B
Display A is Large
Else
Display B is Large
End
Create a flowchart that
subtracts the two numbers
entered by the user.
1. Start
2. Input Number1
3. Input Number2
4. Subtract Number1 and Number2,
Answer=Number1 – Number2
5. Print Answer
6. End
1. START
2. INPUT TIME
3. IF TIME >= 12:01AM
4. DISPLAY GOOD MORNING PRETTY/HANDSOME!!
END
TIME >= 12
Draw flowchart to check Positive Number.
Start
Input Number
If Number > 0
Display “Positive Number”
Else
End