cs1501. what is a computer program? a set of instructions to tell the computer what to do it can be...

7
Introduction to Programming with Alice CS150 1

Upload: mitchell-french

Post on 13-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS1501. What is a computer program? A set of instructions to tell the computer what to do It can be elegant! Not only a way to tell a computer what to

CS150 1

Introduction to Programming with Alice

Page 2: CS1501. What is a computer program? A set of instructions to tell the computer what to do It can be elegant! Not only a way to tell a computer what to

CS150 2

What is a computer program?A set of instructions to tell the computer

what to doIt can be elegant!

Not only a way to tell a computer what to doA computer program is a way to tell another

human being what you want the computer to do

Page 3: CS1501. What is a computer program? A set of instructions to tell the computer what to do It can be elegant! Not only a way to tell a computer what to

CS150 3

Computer programmingAnother way of thinking!Another way of solving problems

Page 4: CS1501. What is a computer program? A set of instructions to tell the computer what to do It can be elegant! Not only a way to tell a computer what to

CS150 4

Ideas in Computer programmingList of instructions, or Sequential processing

“Beat eggs, mix in flour, sugar and shortening, pour into baking pan, then bake at 375 degrees for 45 minutes.”

Ifs“If it is raining, take an umbrella”

Repeating behavior“While there are cookies in the plate keep

eating cookies”“Stomp your foot for five times”

Page 5: CS1501. What is a computer program? A set of instructions to tell the computer what to do It can be elegant! Not only a way to tell a computer what to

CS150 5

Ideas in Computer programmingBreaking things up into smaller pieces

Problem decompositionStepwise refinementTop-down design“The way we are going to clean the house is to first

clean the kitchen, then clean the bathroom, then clean each of the bedrooms one at a time”

Compute a resultQuestions or Functions“How much does the baby weigh?”

“Put this baby on the scale and tell me how many pounds she weighs.”

Page 6: CS1501. What is a computer program? A set of instructions to tell the computer what to do It can be elegant! Not only a way to tell a computer what to

CS150 6

Object-oriented programmingWe use objects!

Page 7: CS1501. What is a computer program? A set of instructions to tell the computer what to do It can be elegant! Not only a way to tell a computer what to

CS150 7

What is Alice?Alice in wonderland is a tribute to a

mathematician, Lewis Carroll… That taught math in a very simple way using

fairy tales.Learning to program will be easier than you

think