Tip:
Highlight text to annotate it
X
Why do we create a plan?
We create a plan so that we know what steps we are going to take
If you are building a house, you create a blue print
if you are going to make something in the kitchen, you have a recipie
There are all sorts of ways to plan things, and some of them have different degrees of depth
for programming at the level that we are at, there are two
standard ways of planning. One is pseudocode, the other is flowcharting.
I’ve found in the past that my students will
go overboard on the planning, or
they will write the program first and then write the plan afterwards
Which really doesn’t help you at all. Planning should be high level
There are a couple of ways to do the
plans, I want to show you some examples for the
sample that I did for your madlibs assignment
This is just a reminder, this was my script. It is based on
“Mary had a little lamb”. Everybody who
does pseudocode does it a little differently . Each person
has their own style. I like to mimic the way a program is
written. To me it is important to figure out what the variables are going to be.
I always list my variables first. I will just list them by
types: strings. If it is a complicated program I will put
in notes next to it - name of person
I usually don’t have to do that on a small program like this, but if I
get a really complex program, I will put notes next to my
variables. Again - the plan is to help YOU
make your program easier to write, so the level of detail is up to you.
I want you to think of pseudocode like you are writing
a paper for an English class. Everyone should have, at this point
done an outline before writing a paper.
You should not have to write a detail line for every sentence
you are going to have in your paper, but you probably should have a line
in your outline for every paragraph that you are going to have, and that is really
how I want you to do your planning for programming. You don't
need to do either pseudocode or flowcharting line by line, though
it is acceptable and proper to do so. Generally,
since it is for your own planning purposes, going slightly higher up to a paragraph
level or equivalent is easier to understand. You don’t want
to take just as long to plan as you do to program, though actually
planning can be more important. Many students start
with their plan by doing a line by line plan
which is still shorter than the program. For example
I have Start: get name, get animal, get color, get noun
Display poems with variable input - end
A shorter version would just have the lines: Get variables from user, Display poem with user input
They both tell you the same thing. It just doesn’t list each variable
one at a time, but since I have already listed the variables, you don’t really need to.
Now the way that translates into a flow chart
I’ve done both flow charts as well
You start, and you always start
with the program name, which would be madlibs. You would have get name
get animal, get color
get noun, display poem and end
Let’s review what these shapes mean. This is just your start and stop shape
And this refers to data, which is either input or output
output could be to a printer, it could be sounds, it could be to a display
which is what we are doing here. So everything we are doing
because we are not really processing anything, is either input or output
That is a little more complex than it absolutely has to be
You can do a very simple flowchart for this program
Madlibs, get variables, display poem, and that really is
enough, that to me is the paragraph level of planning
You should do whatever you are most comfortable with. Most students
start here, but end up here as the programs get more complex
That is also a good way to go.