You are on page 1of 8

Coursework 8: Counter

and Switch
By: Bazar, Mark B.
COUNTER CASE
FLOWCHART
 A flowchart is a diagram representing a workflow or a
process. The counter counts up from an initial value
to an upper limit value. A common type of program
loop is one that is managed by an integer that counts
up to an upper limit from an initial value. Such a loop
is known as a counting loop.
Basic Flowchart Symbols for Counter Case

 - The oval represents the beginning or an end of a process


 - The rectangle means a step of the overall process
 - The arrow indicates a directional flow
 - The diamond works as a decision
 - The rhombus for input/output data
Begin
My example:
Count = 0
Pseudocode

Begin UserClick = 1
Count = 0
Get UserClick
UserClick = 1
Count = Count + UserClick
Display Count
Count = Count +
UserClick
Y
If Another Click, then display “Get
UserClick”, Else display “End”
End Another
Display Count
Click?

N
End
SWITCH CASE
FLOWCHART
 A switch case flowchart describes program execution
via a graphical representation for simplifying computer
programming languages. By displaying a consistent
logical sequence between code blocks, the chart brings
an easy way to manage multiple cases. This is one of
the use cases of flowchart in programming.
 In terms of the flowchart’s structure, it includes the
entrance expression, cases’ conditions, and the default
block. Additionally, you can add a break announcement
block anywhere to skip a labeled announcement for
jumping right to the end.    
 Specifically, users can understand the needed
conditions that execute the value of the expression of
switch blocks. Thus, defining the keyboard command
to run the announcement.
Apart from supporting programming tasks, the switch
case flowchart has a wide range of other applications,
such as:
• Simple calculator configuration
• Selections of available food items at restaurants
• Architectural services
• Shipping services, especially for retail businesses
• Hospitality services with the help of tracking customers to provide essential services    
Basic Flowchart Symbols for Switch Case

 - The oval represents the beginning or an end of a process


 - The rectangle means a step of the overall process
 - The arrow indicates a directional flow
 - The diamond works as a decision
 - The hexagon for preparation
Choice? Begin
My example:
Pseudocode
Press
Y Print
Begin “1” “Coke”
Choice?
Select a number that you want
N
Y
If press “1” for Coke, then print
“Coke”
If press “2” for Pepsi, then print Press Print
“Pepsi” “2” “Pepsi”
If press “3” for Lemon Juice, then
print “Lemon Juice”, else, then
“void (null)” N
Y
End
Print
Press
“Lemon End
“3”
Juice”

N void (null)

You might also like