2013-14 Algorithms Intro - Steps To A Solution
2013-14 Algorithms Intro - Steps To A Solution
Steps to a Solution
What is an Algorithm?
An algorithm must:
be lucid, precise, and unambiguous
give the correct solution in all cases
eventually end
Developing an Algorithm?
Define the problem
It is important to clearly define the
problem
then
Output:
Print total
Input:
Read 3 numbers
Processing:
Add numbers together as they are input
Designing a Solution Algorithm
READ number_1
ADD to total
READ number_2
ADD to total
READ number_3
ADD to total
PRINT total
Implementing a Solution
ADD ingredients
MIX ingredients
ADD water
KNEAD
LET RISE
BAKE
Example #3
Sorting Mail
#Get all the mail from mailbox and put it on the table.
Steps to a Solution