PROGRAMMING IN PYTHON
computer
programming
COMPUTER
PROGRAM
PROGRAMMING
FLOWCHART
ALGORITHM
pseudo code
COMPUTER
A computer is an electronic device that
stores and processes data according to
instructions given to it in a variable program.
It has the ability to accept data (input),
process it, and then produce outputs.
Computers are used for a variety of
purposes ranging from browsing the web,
writing documents, editing videos, creating
applications, playing video games, etc.
program
A program is a set of instructions that a
computer uses to perform a specific
function. It can also refer to a public
notice, a brief outline of a
presentation, or a plan of action.
programming
Programming is the process of writing a
set of instructions that a computer can
understand and execute. It involves the
use of programming languages to create
software, applications, and other
computer programs.
flowchart
A flowchart is a graphical representation of an
algorithm. Programmers often use it as a
program- planning tool to solve a problem. It
makes use of symbols that are connected among
them to indicate the flow of information and
processing. The process of drawing a flowchart
for an algorithm is known as “flowcharting”.
EXAMPLE: *example of a process flowchart.
Fill kettle with Place tea bag in
START
water and boil cup
Remove tea Let tea steep for Pour hot water
bag 3-5 mins. over tea bag
"The above flowchart shows the steps involved in making a cup of
tea. The process starts with filling the kettle with water and boiling
Add milk and Stir and it. Once the water is boiled, a tea bag is placed in a cup, and hot
water is poured over it. The tea is then left to steep for 3-5
sugar enjoy! minutes before the tea bag is removed. Milk and sugar are added
to taste, and the tea is stirred before it is ready to be enjoyed."
EXAMPLE: *example of a program flowchart.
This program flowchart takes two inputs n1 and n2,
adds them together, and outputs the sum. The
symbols used in the diagram represent different
entities such as input/output, processing, and
start/end points. The arrows represent the flow of
control between the entities.
algorithm
The word Algorithm means “a process or set of
rules to be followed in calculations or other
problem-solving operations”.
Therefore, algorithm refers to a set of
rules/instructions that step-by-step define how a
work is to be executed in order to get the
expected results.
HERE IS AN EXAMPLE OF AN ALGORITHM THAT CALCULATES THE SQUARE OF A GIVEN NUMBER.
INPUT: THE INPUT DATA IS A SINGLE-DIGIT NUMBER (E.G., 5).
TRANSFORMATION/PROCESSING: THE ALGORITHM TAKES THE INPUT (NUMBER 5)
AND PERFORMS THE SPECIFIC OPERATION (I.E., MULTIPLIES THE NUMBER BY
ITSELF).
THE ABOVE ALGORITHM CAN BE ILLUSTRATED AS FOLLOWS:
5 25
THE ABOVE ALGORITHM TAKES AN INPUT OF 5 AND RETURNS THE SQUARE OF 5,
WHICH IS 25.
Different flowcharting symbols
In designing a website, building an app, or mapping a
business system, a software developer needs a way to
chart steps and user flows clearly.
EXAMPLES:
1. Terminator symbol
Meaning: the start or end of a process
An oval symbol marks the first and last
steps of a process. You can include
“start” or “end” in the oval to highlight
their order. You can use more than one
oval for processes with multiple USED FOR: noting the
outcomes. Labeling these ovals with beginning and end of a
numbers or letters helps you track each process.
endpoint in a complex user journey.
2. Action symbol
Meaning: the actions or steps needed
to carry out a process
A rectangular action symbol represents
any step in a process. As a result,
some teams call it a process symbol.
These steps connect basic tasks or
actions needed to reach an outcome.
Manual actions and automatic steps USED FOR: represents
the steps or actions in a
both use this symbol, making it one of
process.
the most popular symbols in
flowcharting.
3. Decision symbol
Meaning: decisions that break
flowcharts into multiple routes
Diamond markers symbolize decisions
users make at crossroads in a
flowchart. You can place decision
markers at simple forks in the road or
points leading to multiple paths. More
USED FOR: symbolizing
often than not, decision markers decisions users make as
represent a true/false or yes/no they move through a
question. flowchart.
4. Directional flow symbol
Meaning: the paths a flowchart’s user
takes between steps
Arrows guide users along paths on a
flowchart. Arrows lead between
different process symbols to show how
actions lead to outcomes. In this sense,
directional flow highlights cause and
USED FOR: guiding users
effect. Dotted or dashed arrows can through sequential steps
represent alternate paths to the same in a flowchart.
outcome.
5. Input and output symbol
Meaning: data or finished products entering
and leaving a process
Input and output symbols reveal when goods or
data enter and leave a system. Sometimes
called the data symbol, this icon shows how
resources are used or generated. Inputs refer to
something a user enters, while outputs can
mean any data or products built by a system.
For example, customer orders and payments USED FOR: showing where
represent a system input. Once you process users input data or a
this input, your system gives an output, such as system outputs
an order delivery. When adding this symbol,
information and products.
specify whether it means an input or an output.
6. Preparation symbol
Meaning: setup or preparation needed
to move on to the next step
Preparation symbols represent the
setup for another step in your process.
They can also differentiate between
steps designed to prepare you for work
and the steps involving that work.
USED FOR: pointing out
Remember that preparation symbols
steps that involve
apply to the process they sit within, so
preparation for later parts
preparation to use an outside tool or
of the process.
resource wouldn’t call for this symbol.
7. Alternate process symbol
Meaning: an alternate progression to
the normal step flow
Alternate process symbols show how a
system can deviate from its standard
process flow. These alternate paths
often lead to the same outcome as
basic process symbols, but they can
USED FOR: showing
also lead to unique outcomes. Dotted
alternate paths through a
or dashed arrows represent the path
process flow that may lead
between alternate steps in process
to unique outcomes.
mapping.
8. Predefined process symbol
Meaning: a separate process mapped out
elsewhere
This symbol shows up when your flowchart
initiates a process you defined elsewhere.
Typically, these processes are too complex to
fit onto your flowchart. In other cases, the
process is well known, and the symbol works
as a shorthand. So, teams use the predefined
process symbol to keep charts as clear as USED FOR: executing a
possible. process that’s well-known
Some teams call this a subroutine symbol in
or mapped on a different
the context of programming flowchart
flowchart.
symbols.
9. Loop limit symbol
Meaning: indicates the point at which
looping steps should stop
Some programming tools use loops, or
processes that repeat themselves.
These loops can repeat automatically
until they reach a desired outcome.
This programming symbol states when
USED FOR: indicated
a loop should stop, either after giving
points where an automatic
the correct result or going through a
loop will stop.
predetermined number of loops.
10. Delay symbol
Meaning: a delay or pause in the
progression of steps
Delay symbols highlight segments of
your process when users have to wait
and how long the delay will last. While
they sound inconvenient, delays play
an important role in your processes. USED FOR: highlighting
For example, you might include a delay out parts of a process
when taking extra risk-prevention where users have to wait.
steps.
11. Manual input symbol
Meaning: steps where users have to
enter information manually
Manual input symbols point out steps
prompting users for information. For
example, users need to enter a manual
input when logging onto their account
USED FOR: mapping
or entering shipping information.
prompts asking users for
information.
12. Manual operation symbol
Meaning: a non-automated process you
must complete manually
Manual operation symbols highlight tasks
users have to complete themselves. You
can’t automate every process in a flowchart,
so this symbol helps teams consider how
they’ll build a user-friendly version of this
process.
Some teams refer to this as the manual loop USED FOR: highlighting
symbol, coming in when a process doesn’t non-automated tasks users
have a loop limit. Instead of making an AI end has to complete
the loop, users will stop it themselves. themselves.
13. Document symbol
Meaning: a document, report, or form
containing relevant information
Document symbols highlight when
users input a document or when a
program generates one. For example,
you'd use this symbol when telling a
user to create an invoice or accept a USED FOR: revealing when
memo. You can also stack multiple internal or external
document symbols to represent documents play into a
multiple forms. process.
14. Data storage and stored data
symbol
Meaning: a step where data gets
stored within a program
Stored data symbols reveal when data
enters a program’s storage. Use this
symbol when describing specific data
used for one step or broader data USED FOR: describing
relevant to an entire process. data that enters a
program’s storage during a
process.
15. Internal storage symbol
Meaning: information stored in a
system’s internal memory
Internal storage plays a role in software
design flowcharts. Flowchart designers
use this symbol when going through a
process that stores information. This
symbol applies to information entered USED FOR: explaining
by users or generated by programs. what information goes into
internal system memory.
16. Hard disk symbol
Meaning: location where data gets
stored on a hard drive
Teams use this symbol when using
direct access storage, or hard drive
storage, during a process. When a
program doesn’t use online databases,
local storage keeps data safe and USED FOR: explaining
accessible. what data get stored into
direct access or hard drive
storage.
17. Database
Meaning: data listed in a standard
structure that allows for sorting and
searching
Database symbols represent
information kept in modern storage.
Unlike tape data, databases allow you
to search and access data in any order. USED FOR: representing
You can also filter the data for different information kept in a
modern storage database.
users.
18. Collate symbol
Meaning: orders information in a
standard format
Collate symbols pop up when
processes standardize information.
Systems often draw on data points in
different formats. Collate symbols
reformat this information and USED FOR: reformatting
standardize it into a new arrangement. different typer of
information into a
standardized arrangement.
19. Sort symbol
Meaning: organizes a list of items into a set
or sequence based on predetermined criteria
Sort symbols collect data from across a
flowchart and compile it like collate symbols.
However, sort symbols can create flowchart
categories, combine processes, and lay out
actions in sequence. Sort symbols don’t USED FOR: organizing
necessarily standardize the data they
different lists or processes
collect.
into related categories.
20. Annotation/comment symbol
Meaning: provides additional
information on a step in a process
Flowchart writers use annotations or
comments to explain their processes in
more detail. This symbol can provide
instructions or contextual information.
Remember that these annotations often USED FOR: sharing
help designers and developers rather information with designers
than the end user. and developers when
building a product or
process.
21. Display symbol
Meaning: indicates a step that displays
information
Some processes automatically display
information as users move along.
Display symbols indicate when this
happens and what information will be
displayed. Unlike annotations, display USED FOR: giving
symbols focus on customers’ needs information to users as
over internal teams’. they move through a
process.
22. Or symbol
Meaning: a branch in the flow where
users must choose one path or another
Flows can branch off into two paths
depending on user inputs or goals. An
or symbol highlights these branching USED FOR: branching
points in a user’s flow. users flows into two paths
they can choose from.
23. Merge symbol
Meaning: a point where two steps,
lists, or processes combine
On flowcharts, lists and processes can
branch off and reconnect. Merge
symbols let the reader know when this
occurs. In other cases, merge symbols USED FOR: combining two
combine previously unrelated lists or processes into one
processes or lists. flow.
24. Summoning junction symbol
Meaning: points where multiple flows
or paths converge back into a single
process
Summoning junctions work like merge
symbols for more than two branches.
Summoning junction symbols combine USED FOR: converging
three or more flows and lists into a more than two flows or
single process. paths into a single process.
25. On-page connector symbol
Meaning: points where flows end and
resume on different parts of a chart
On-page connectors link different
elements on a page, and can replace
long arrows on a complex flowchart.
Keep track of each symbol by placing USED FOR: charting a flow
the same letter or number inside two between two different
connectors. points on a flowchart.
26. Off-page connector symbol
Meaning: points when a flow ends on a
page and resumes on another chart
Complex flow charts use off-page
connectors to link elements across
pages. A page number will often sit
beside the connector to show you USED FOR: connecting a
where the symbol connects. Off-page process on one page to
targets occur more within complicated another flowchart.
systems.
pseudo code
Pseudo code is a mixture of language and symbols, terms
and other feature commonly used one or more high-level
languages. High-level languages are programs used by the
computer. Typically, the common features of various
pseudo codes that appear in textbook are the following:
1. The usual computer symbols are used for arithmetic
operations: "+" for addition, for subtraction, "*" for
multiplication, and "/" for division.
pseudo code
2. Symbolic names (identifiers) are used to represent
quantities being processed by the algorithm.
3. Certain keywords that are common in high-level
language may be used, for example, read or enter to
indicate input operation; display, print and write for output
operations.
4. Indentation is used to set off certain key blocks of
instructions.
pseudo code
The structure of an algorithm can be displayed in a
structure diagram that shows the various that must be
performed and their relation to one another. These
diagrams are especially useful in describing algorithms
for more complex problem. This section will show
similar examples used in flowchart development that
will illustrate the three basic control structures -
sequential, selection, and repetition and how to
present algorithms in pseudo code.
Basic Control Structures:
Sequence
Selection
Repetition
Control Structures are a fundamental concept in
programming that allow you to control the flow of your
program. They are used to specify the order in which
statements are executed in a program. There are three
basic types of control structures: sequence, selection,
and iteration.
Sequence
This is the default control structure, where
statements are executed one after another
in the order in which they appear in the
program.
Sequence Example
Algorithm that shows how to determine the product of three numbers.
Algorithm that shows how to determine the product of three numbers.
Selection
This control structure is used to test a
condition and execute different statements
depending on whether the condition is true
or false. There are three types of selection
structures: if, if-else, and switch.
Selection example
Iteration
This control structure is used to execute a
block of statements repeatedly until a
certain condition is met. There are two
types of iteration structures: while and for.
Iteration example
THE END