welcome to this presentation on creating
flowcharts when you're trying to code a
program especially a really complicated
program it's really helpful to be able
to organize your thoughts organize the
process organize the pattern of how
you're going to get the outcome that you
want and flowcharts are an amazing tool
for making that happen so what is a
flowchart
well it's a schematic it's a diagram
that uses special symbols in place of
the actual pictures in a wiring
schematic for example a squiggly line is
used to represent a resistor and many of
my students are already familiar with
that an algorithm is a series of steps
that tell how to complete a task for
example an algorithm for a reducing a
mathematical expression could be first
perform the operations contained within
the parentheses then calculate the
exponent if if there is one next
multiply and divide from left to right
finally add and subtract from left to
right that is an example of an algorithm
for a process that you're already
familiar with here we have a simple very
simple flowchart
that might show the steps in feeding a
dog as we look at the parts of a
flowchart note that the different
processes have different shapes all
right so let's go ahead and talk about
those different shapes and what they
symbolize what we use them for so start
end the design process is an iterative
process iteration is the act of
repeating a process either to generate
an unbounded sequence of outcomes or
with the aim of approaching a desired
goal target or result your flowcharts
may repeat steps or they may backtrack
several steps we always begin them with
the rounded rectangle that represents
start the rectangles used for the
process step process is basically the
verb what are we doing all right what
kind of things are we doing like feeding
the dog in that previous example adding
1 turn the motor on turn the light off
so forth input and output so many times
in a program the user needs to input
some data or some values or the program
is going to output information to the
user or to another computer so for this
we use a parallelogram indicates that
our manual operations needed and some
examples are given there next we have
decision this shape is a rhombus for
geometry you may remember that a rhombus
is a quadrilateral with all four sides
congruent or equal right it is different
from a square in that the angles are not
all right angles like a square some
refer to this block as a diamond because
it has been rotated about 45 degrees
whereas most rhumba lie on their bases
so here's where our decisions come this
is where we're going to be asking yes or
no questions and our program our
flowchart is going to go off in two
different directions based on the
answers to those questions and there's
some examples there arrows we need to
keep track of the direction of the flow
right and so arrows do that for us
sometimes there's one arrow in case of
decisions there may be two arrows for
yes or no yes for one direction no for
another all right so let's take a look
at an example what we want is a program
a flowchart for counting from 1 to 9 but
only in odd numbers so before attempting
to draw the flowchart what do you think
the output might be also what is the
first block well the output would be 1 3
5 7 and 9 right those are the odd
numbers that are between 1 and 9 or
including 1 and 9 and the start block is
always going to be the first one so
let's start with the start block all
right very good so there's our start
block we're off to a great
start what are we gonna do next well the
program has to begin with the number 1
so let's go ahead and do that we're
gonna put a parallelogram there and
input the number 1 next step well it's
the process of actually saying that
number right the computer needs to save
that number 4 so we're going to put that
as a process of what the computer is
going to do next to move from 1 to 3 we
would add to this is a crucial step
because it determines the pattern for
the rest of the process
next we're going to add a decision block
do we go on or are we done right we need
a decision block to determine that are
we greater than 9 or do we need to keep
going so if you can imagine this we're
starting with 1 it says the number 1 we
put in put the number 1 the flowchart
says the number 1 then it adds 2 and
week 3 is 3 greater than 9 no so we go
back and it's gonna say that new number
right this is the number that is now 2
more so it's gonna say the number 3 it's
gonna add 2 more gives us 5 is that
greater than 9 no so it's gonna go back
and say the number 5 it's gonna add 2 is
that number greater than 9 no now we're
at 7 so we'll go back and we say the
number 7 we add 2 more and we get to 9
excellent are we greater than 9 no so we
goes back and it says the number 9 then
it adds two more
now we're 11 are we greater than 9 yes
we are greater than 9 and when you're
greater than 9 then the program comes to
an end
and there we go and so excellent so
here's an example of our flowchart now
that you understand how a flowchart
works you understand the different
shapes the different blocks that go into
a flowchart here's what I want you to do
I want you to create a flow chart that
shows how to pour a glass of milk all
right I want you to create this flow
chart put it in your notebook I think
but you got to think about it gentle
just start writing this stuff down you
have to think about how this process is
going to work how is this process the
same or different than the two that
we've already seen in this video does it
matter what your start represents what
sort of assumptions do you make when you
create a flow chart like this one all
right
does it matter if the glut is a glass
already out is the milk already out are
you gonna clean the glass at the end are
you gonna drink the glass of milk or are
you gonna put the milk away alright so
there's all these issues you have to
think about when you create your flow
chart alright so create that flow chart
in your notebook and then show that to
your instructor alright thank you for
watching the video
you