0% found this document useful (0 votes)
295 views10 pages

N-Pizza Dough Algorithm Explained

The document discusses algorithms and their use in programming. It defines an algorithm as a finite set of unambiguous instructions performed in a prescribed sequence to achieve a goal. Algorithms allow turning a process like making pizza dough into a step-by-step set of instructions. The document presents examples of algorithms for making pizza dough and a variable version that allows making multiple batches. It notes algorithms contain elements like sequences of statements, variables, conditionals, and subroutines. The last part states programs implement algorithms by communicating instructions to computers in a programming language like Python.

Uploaded by

WaiChipNgai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
295 views10 pages

N-Pizza Dough Algorithm Explained

The document discusses algorithms and their use in programming. It defines an algorithm as a finite set of unambiguous instructions performed in a prescribed sequence to achieve a goal. Algorithms allow turning a process like making pizza dough into a step-by-step set of instructions. The document presents examples of algorithms for making pizza dough and a variable version that allows making multiple batches. It notes algorithms contain elements like sequences of statements, variables, conditionals, and subroutines. The last part states programs implement algorithms by communicating instructions to computers in a programming language like Python.

Uploaded by

WaiChipNgai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd

The Algorithm

Institute for Personal Robots in Education


(IPRE)

CS 1 with Robots

The Algorithm

Algorithm:
n. A finite set of unambiguous instructions
performed in a prescribed sequence to
achieveagoal- The American Heritage Science Dictionary

Aug 20 2007

The Algorithm
Al-Khwarizmi was a Persian
mathematician who wrote a
book on calculating with Hindu
numerals in the 9th century A.D.
When translated to Latin, a
pluralized form of his name
(algorismus) became
synonymous with a system of
calculation.

Aug 20 2007

Pizza Dough Recipe (Algorithm)


1. Gather Ingredients
2. Combine sugar (1tbs), salt
(1tbs), olive oil (1tbs), flour (1c)
in mixing bowl
3. Turn on mixer
4. Add 1/4 cup of flour
5. If dough comes off the sides go
to step 6, otherwise go back to
step 4
6. Knead 15 minutes
7. Let rest for at least 45 minutes in
warm area

Aug 20 2007

1 dough ball

N-Pizza Dough Algorithm


Gather Ingredients
Combine sugar (N tbs), salt (N
tbs), olive oil (N tbs), flour (N c)
in mixing bowl
Turn on mixer
Add N/4 cup of flour
If dough comes off the sides
go to step 6, otherwise go back
to step 4
Knead 15 minutes
Let rest for at least 45 minutes
in warm area

Aug 20 2007

N dough balls

N-Pizza Dough Algorithm


Gather Ingredients
Combine sugar (N tbs), salt (N
tbs), olive oil (N tbs), flour (N c)
in mixing bowl
Turn on mixer
Add N/4 cup of flour
If dough comes off the sides
go to step 6, otherwise go back
to step 4
Knead 15 minutes
Let rest for at least 45 minutes
in warm area

Aug 20 2007

Sequence of
Statements

N dough balls

N-Pizza Dough Algorithm


Gather Ingredients
Combine sugar (N tbs), salt (N
tbs), olive oil (N tbs), flour (N c)
in mixing bowl
Turn on mixer
Add N/4 cup of flour
If dough comes off the sides
go to step 6, otherwise go back
to step 4
Knead 15 minutes
Let rest for at least 45 minutes
in warm area

Aug 20 2007

Variable

N dough balls

N-Pizza Dough - Algorithm


Gather Ingredients
Combine sugar (N tbs), salt (N
tbs), olive oil (N tbs), flour (N c)
in mixing bowl
Turn on mixer
Add N/4 cup of flour
If dough comes off the sides
go to step 6, otherwise go back
to step 4
Knead 15 minutes
Let rest for at least 45 minutes
in warm area

Aug 20 2007

Conditional

N-Pizza Dough - Algorithm


Gather Ingredients
Combine sugar (N tbs), salt (N
tbs), olive oil (N tbs), flour (N c)
in mixing bowl
Turn on mixer
Add N/4 cup of flour
If dough comes off the sides
go to step 6,
otherwise go back to step 4
Knead 15 minutes
Let rest for at least 45 minutes
in warm area

Aug 20 2007

Subroutines
Mini-algorithms

N dough balls

Programs - Algorithms at Work

Programs are the way we


communicate with a computer
Specify the algorithm
This class uses the Python
programming language
Rather than pizza dough, we
will use a robot as our favorite
example

Aug 20 2007

10

You might also like