You are on page 1of 11

FLOWCHART

(1st Semester, 1st Quarter, Week 4-5)

Flowchart
 A chart that contains symbols referring to computer operations, describing how the program performs.
 A graphic map of the path of control or data through the operations in a program or an information-handling
system.
 Symbols such as squares, diamonds, and ovals represent various operations.
 These symbols are connected by lines and arrows to indicate the flow of data or control from one point to
another.

Flowchart Symbols

1. Terminal Block 5. Initialization Block

2. Process Block 6. Connector

3. Input/Output Block 7. Flow Lines

4. Decision Block

Terminal Block

 Ovals or rounded rectangles are used to indicate the start and the end of a module or program.
 An oval is labeled with the name of the module at the start.
 The end is indicated by the word end or stop for the top or Control Module.
 A start has no flow lines entering it and only one exiting it; an end has one or more flow lines entering it but
none exiting it.

Developed by:
Joshua F. Madera
Master Teacher II
Computer Programming - JAVA
1st Semester 1st Quarter Week 4 to 5
Page 1 of 11
Example:

Start

End

Process Block

 The rectangle indicates a processing block, for such things as calculations, opening and closing files, and so
forth.
 A processing block has only one entrance and also only one exit.
 Usually inside a process block are variables that contain values.
 These variables are used for equations and calculations.

Example:

A=B+C Sum = 75 + 82 Average = Sum/2

Input/Output Block

 An Input/Output block has only one entrance and also only one exit.
 This block can be used either for Input or for Output purposes.
 If used as an Input, it means that there is a part of a program that needs to enter or input a value to something
like in variables.
 If used as an Output, it means that the program needs to show or display something like values came from
computations and calculations.
 It can also use to show or display a message notification telling something.

Example: Used as Input

Get Sum, Diff, Input


Prod, Quot Gender

Developed by:
Joshua F. Madera
Master Teacher II
Computer Programming - JAVA
1st Semester 1st Quarter Week 4 to 5
Page 2 of 11
Example: Used as Output

show
display Average show “Invalid “Congratulations, You
Input” Passed!”

Decision Block

 The diamond shape indicates a decision.


 It has only one entrance and exactly two exits from the block.
 One exit is for the action when the resultant is TRUE and the other exit is for the action when resultant is
FALSE.
 Only use conditions inside a Decision block. It only means that do not use long words, phrases or sentences
inside a decision block.

Example:

T F
Condition?

Action when Action when


TRUE FALSE

T Age >=12 F T F
and Grade >= 75?
Age <=19

show “You’re a show “You’re an


Teenager” Adult” show “Passed!” show “Failed!”

Developed by:
Joshua F. Madera
Master Teacher II
Computer Programming - JAVA
1st Semester 1st Quarter Week 4 to 5
Page 3 of 11
Initialization Block

 Used for declaring / initializing variables needed to solve a certain process.


 Note: You can only use variables that had been initialized.
 Has only one entrance and also only one exit.
 There are 2 components inside an Initialization block, Declaration and Initialization.

Declaration
 Binding an Identifier by stating a variable name/s to be used in all parts of the flowchart.

Initialization
 To set (a starting value of a variable).

Example:

name = ”Juan”, firstQtr = 90,


age = 18, secondQtr = 85,
variable = value gradeLevel = 11, sum = 0,
strand = “ICT” average = 0

Connector

 The circle is used as a connection point between two sections of a flowchart that are not adjacent or closely
located to each other.
 Note: These connectors should be used as little as possible. They should only be used to enhance readability.
Overuse, however, decreases readability and produces a cluttered or crowded effect.

Flow Lines

 Indicated by straight lines with arrows to show the direction of data flow.
 The arrowhead is sometimes not shown when the direction of flow is clear.
 Used to connect blocks by exiting from one and entering to another.

Developed by:
Joshua F. Madera
Master Teacher II
Computer Programming - JAVA
1st Semester 1st Quarter Week 4 to 5
Page 4 of 11
Flowchart Example No. 1

Create a flowchart that will ask a student to enter his/her information. After entering all necessary
information, the flowchart should display the personal information of the student particularly Full Name, Track,
Strand, Grade Level and Section.

Answer:
Start

name = ” ”,
track = “ “,
strand = “ “,
gradelevel = “ ”,
section = “ “

Input
name, track,
strand,
gradelevel,
section

Display
name, track,
strand, gradelevel,
section

End

Explanation:

Based on the given problem, first we need to declare all necessary variables that will hold the value of
all needed information of a student. That’s why we used an Initialization block to declare and initialize all the
variables. Next we used an Input block to ask for the input of the values for each variables. Lastly, we also
used an Output block to display the value of each variable pertaining the personal information. As you can see,
the variables inside the Output block are not enclosed inside of the (“ “) mark. It is because we only used the
double quotation symbol (“ “) if we need to print, display or show short messages as notification. But if we’re
going to print, display or show values of variables just like in the example, just call the variable names separated
by a comma ( , ) but do not enclose it with the (“ “) mark.

Developed by:
Joshua F. Madera
Master Teacher II
Computer Programming - JAVA
1st Semester 1st Quarter Week 4 to 5
Page 5 of 11
Flowchart Example No. 2

Create a flowchart that will asked a user to input values of 2 numbers. After entering values of the 2
numbers, show the sum of 2 numbers.

Answer:
Start

Num1 = 0,
Num 2 = 0,
Sum = 0

Input
Num1, Num2

Sum = Num1 + Num2

show Sum

End

Explanation:

Based on the given problem we need to use an Initialization block to declare and initialize variables that
will hold values of the 2 numbers. The values of the 2 numbers are not determined nor mentioned in the
problem. It means that you can think of any value for the 2 numbers. You also need to make variable name for
the 2 numbers. We named them Num1 for the first number and Num2 for the second number. Also we need to
declare another variable named Sum that it will be the one that will hold the value for the sum of the 2 numbers.
Next we also used an Input block to ask for the values of the 2 numbers. We don’t need to enter a value for the
sum because it will be automatically be computed using a Process block when we already entered values of 2
number. That is why we don’t need to include the variable sum in the Input block to ask a value for it. A
Process block appeared in the flowchart after the Input block. Inside of the process block is the computation to
compute and get the Sum of the 2 variables holding the values of 2 numbers. After getting the sum of 2
numbers, we used an Output block to display its value. As you can see, the variable sum inside the Output
block is not enclosed inside of the (“ “) mark. It is because we only used the double quotation symbol (“ “) if
we need to print, display or show short messages as notification. But if we’re going to print, display or show a
value of a variable just like in the example, just call the variable name but do not enclose it with the (“ “) mark.

Developed by:
Joshua F. Madera
Master Teacher II
Computer Programming - JAVA
1st Semester 1st Quarter Week 4 to 5
Page 6 of 11
Flowchart Example No. 3

Create a flowchart that will asked a user to input his/her grade in Computer Programming. If the grade
entered is equal or above 75% display “Congratulations, You Passed!”. But if the grade entered is less than
75% display “Study Hard”.

Answer:

Start

Grade = 0

input Grade

T F
Grade >= 75?

show show
“Congratulations, “Study Hard”
You Passed!”.

End
Explanation:

First we need an Initialization block to declare and initialize a variable named Grade. Next an Input block
appears that will handle the entering of value for the variable Grade. Although it is not mentioned in the
problem what should be the value of the variable Grade, the flowchart shows that we can think of any value
and we can assign any value for the variable Grade. After that, we used a Decision block with a condition
asking if the entered grade is greater than or equal to 75. If the condition results to True, an Output block
appears that will display “Congratulations, You Passed!”. Otherwise, another Output block will appear to
display “Study Hard” because the condition results to False. Whatever action will be executed after the decision
block, the flowchart should end. As you can see, both of the notifications inside the Output block are enclosed
inside of the (“ “) mark. It is because we only used the double quotation symbol (“ “) if we need to print, display
or show short messages as notification. But if we’re going to print, display or show a value of a variable, just
call the variable name but do not enclose it with the (“ “) mark.

Developed by:
Joshua F. Madera
Master Teacher II
Computer Programming - JAVA
1st Semester 1st Quarter Week 4 to 5
Page 7 of 11
Flowchart Example No. 4

Create a flowchart that will display the Circumference of a circle. The circle has a Radius of 12inches. It
has a constant value of PI of 3.14.

Answer:
Start

circum = 0,
PI = 3.14,
radius = 12

get
circum

circum = 2(PI)radius

show circum

End

Explanation:

First we need an Initialization block to declare and initialize the needed variables. Based on the problem
the only given is the radius with a value of 12 but we need to analyze that in order to get the circumference of
a circle we need other variable names for other variables like circumference and PI. Think of a variable name
for circumference. In the flowchart we used circum. For the PI we used the PI variable name with a constant
value of 3.14. As you noticed why the variable circum has an initial value of 0? It is because in reality we don’t
know yet what will be the value of the circumference until we computed it. But we need to declare the variable
circum so that we can use it in our future computations. Unlike the variables radius and PI, they value are
already determined based on the problem. Next we used an Input block to call the variable circum so that we
can use it now for computation. We also used a Process block to compute for the value of circumference based
on a formula(circumference = 2 * PI * r). Lastly, we used an Output block to show the computed value of the
variable circum. Remember that we just need to determine the flow of the Flowchart. It doesn’t need to be
always show the computed value at the end. We just focus on the objective of getting the cirdumference by
following a flowchart.

Developed by:
Joshua F. Madera
Master Teacher II
Computer Programming - JAVA
1st Semester 1st Quarter Week 4 to 5
Page 8 of 11
Activity 1

Create a flowchart that will display the Area of a circle. The circle has a Radius of 5cm. It has a constant
value of PI of 3.14. Follow the examples from the Flowchart Example No. 1-4 to be able to create your own
flowchart. Also follow the given rubrics below.

Activity 2

Create a flowchart that will display the Area of a rectangle. The formula of Area of rectangle is A = l x
w. Where A stands for area, l for length and w for width. Follow the examples from the Flowchart Example
No. 1-4 to be able to create your own flowchart. Also follow the given rubrics below.

Activity 3

Create a flowchart that will ask the user to enter a Gender. If the user enters a value of “M” the flowchart
will display a message notification saying “You’re a Male”. On the other hand, If the user enters “F” a message
notification will display “You’re a Female”. Follow the examples from the Flowchart Example No. 1-4 to be
able to create your own flowchart. Also follow the given rubrics below.

Criterion Description Points


Analysis The flowchart exhibits analysis of the problem by breaking it down into
5
smaller tasks.
Solution The flowchart includes all the key elements to help visualize a final,
5
generalized solution.
Symbols The flowchart shows proper uses of symbols for start and stop, actions, and
2
decisions.
Descriptions Descriptions in the symbols are clear and concise.
2
Arrows Arrows are present in the flowchart that indicate the program flow.
2
Organization The flowchart is neat, logically organized, and easily understood by someone
2
other than the author.
Feasibility The program described by the flowchart is feasible and can be executed.
2

Developed by:
Joshua F. Madera
Master Teacher II
Computer Programming - JAVA
1st Semester 1st Quarter Week 4 to 5
Page 9 of 11
Quiz

Create a flowchart that will display for the General Average of a student. The flowchart will ask the user
to enter grades for the ffg: Grade for the 1st Sem 1st Quarter, Grade for the 1st Sem 2nd Quarter, Grade for the
2nd Sem 1st Quarter, Grade for the 2nd Sem 2nd Quarter. After entering the needed grades, the flowchart will
compute for the General Average. After getting the general average, the flow will proceed to a decision asking
if the general average is passed or failed. If the general average is greater than or equal to 75, the flowchart
will display “You’re Passed”. Otherwise it will display “You’re Failed”. Use the recommended variable names
below for your flowchart.

What you need are 7 variables namely


a. fsemfqtr = will hold the value for the 1st Semester 1st Quarter
b. fsemsqtr = will hold the value for the 1st Semester 2nd Quarter
c. ssemfqtr = will hold the value for the 2nd Semester 1st Quarter
d. ssemsqtr = will hold the value for the 2nd Semester 2nd Quarter
e. ave1 = will hold the value of (fsemfqtr + fsemsqtr) / 2
f. ave2 = will hold the value of (ssemfqtr + ssemsqtr) / 2
g. ga = will hold the value of the General Average that came from (ave1 + ave2) / 2

Follow the examples from the Flowchart Example No. 1-4 to be able to create your own flowchart. Also
follow the given rubrics below.

40 Points

Criterion Description Points


Analysis The flowchart exhibits analysis of the problem by breaking it down into
10
smaller tasks.
Solution The flowchart includes all the key elements to help visualize a final,
10
generalized solution.
Symbols The flowchart shows proper uses of symbols for start and stop, actions, and
4
decisions.
Descriptions Descriptions in the symbols are clear and concise.
4
Arrows Arrows are present in the flowchart that indicate the program flow.
4
Organization The flowchart is neat, logically organized, and easily understood by someone
4
other than the author.
Feasibility The program described by the flowchart is feasible and can be executed.
4

References:

Deitel, H., & Deitel, P. (2004). Java: How to program (early objects). Prentice Hall.
Lambert, K., Osborne, M. (2011). Fundamentals of Java. Cengage Learning Asia Pte Ltd.

Developed by:
Joshua F. Madera
Master Teacher II
Computer Programming - JAVA
1st Semester 1st Quarter Week 4 to 5
Page 10 of 11
Answer Key in Quiz

Start

fsemfqtr=0, fsemsqtr=0,
ssemfqtr=0, ssemsqtr=0,
ave1=0, ave2=0,
ga=0

input
fsemfqtr, fsemsqtr,
ssemfqtr, ssemsqtr

Get
ave1, ave2

ave1 = (fsemfqtr + fsemsqtr) / 2


ave2 = (ssemfqtr + ssemsqtr) / 2

Get
ga

ga = (ave1 + ave2) / 2

T F
ga >= 75?

show show
“You’re Passed” “You’re Failed”

End

Developed by:
Joshua F. Madera
Master Teacher II
Computer Programming - JAVA
1st Semester 1st Quarter Week 4 to 5
Page 11 of 11

You might also like