-
One thing you'll hear or see referred to a lot
-
is something called a flowchart
-
either in computer science, so really when people
-
talk about any type of algorithm or process.
-
So what I thought I would do
-
is for every program I write, is do a simple flowchart
-
maybe I won't do it for every one,
-
but I'll start with one of the basic ones,
-
just so we understand that a flowchart isn't anything fancy.
-
So in this factorial program that we had been looking at in the past couple videos
-
Any flowchart you're just going to be at a starting point
-
I guess, depicted with a circle or oval of some kind.
-
And so we start at this line above this assignment
-
of the number where we actually ask for input from the user.
-
And then after that, we ask for input from
-
the user. This line right here.
-
We are asking for input from the user.
-
So this right over here
-
And we will depict that by a parallelogram.
-
And that is input from the user.
-
And then we'll just say number
-
equals user input.
-
And you can be a little bit loosey-goosey with the terminology
-
here, you're really just trying to tell us what you're doing in this step.
-
The parallellogram tells us that we are somehow interfacing with the user.
-
We're either taking something from the user or we're outputting something to the user.
-
So here, we're saying user input is equal to number.
-
We're assigning number to user input.
-
Then, the next thing we do is just a straight up operation.
-
We just set product to be equal to 1
-
And there we just do that in a rectangle.
-
Product equals 1.
-
Product is equal to one.
-
And then, something interesting is going to happen.
-
We enter into our for loop.
-
And we start with, and what I'm going to do here
-
is I'm going to write it a little bit different than we wrote it over here.