Algorithms

advertisement
Programming Tools for
Solution Development
Module 3 Lesson 2 Assignment: Notes
Solution Development Tools
• Create an algorithm using:
– Pseudo Code
– Flow Charts
What is an Algorithm?
An algorithm is a formula or
set of steps for solving a
particular problem.
This process can be very
helpful in programming.
To be an algorithm:
• There must be:
–A clear set of rules.
–A clear stopping point.
We use algorithms every day.
When you bake a cake, you
are using an algorithm.
You have a recipe with a set of
steps to prepare and bake
the cake, and a definite
stopping point when the
cake is done.
Let’s develop an algorithm:
This defines the problem to solve:
How to bake a Chocolate Cake.
The recipe provides a written description of
what needs to be done.
Next: Write the instructions in “pseudo
code.”
This code shows your steps or algorithm to solve
the problem using “pseudo code.”
Pseudo code is written in “natural language.” It
provides an informal way to describe an algorithm in
words.
Lastly, create a flow chart to depict the
instructions for the recipe.
The flow chart is a pictorial view of an algorithm.
Can you read through the steps of the flow chart?
Here are the steps to bake the
chocolate cake:
•
•
•
•
Mix the ingredients
Spread in Pan
Bake at 350 degrees
Check with fork
– If not done:
• Bake at 350 degrees
• Check with fork
– When ready:
• Remove from oven
• Let cool
• Eat
Download