Kids computer-programming

2,325 views

Published on

The very first introduction.

Published in: Education
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,325
On SlideShare
0
From Embeds
0
Number of Embeds
271
Actions
Shares
0
Downloads
149
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Kids computer-programming

  1. 1. Computer ProgrammingEd Burns, Oracle Corporation
  2. 2. Computer Programming What is a program? A computer program is a file, just like adocument in Microsoft Word or a picture inKidPix. Copyright 2012 Ed Burns, Creative Commons License 2
  3. 3. Computer Programming What is a program? + = With Microsoft Word or KidPix you use thecomputer to create text or images to be read orviewed by humans. + = Copyright 2012 Ed Burns, Creative Commons License 3
  4. 4. Computer Programming What is a program? + = With a computer program, you use thecomputer to create instructions to be read by acomputer! Copyright 2012 Ed Burns, Creative Commons License 4
  5. 5. Computer Programming What are instructions? + = The instructions that make up a computerprogram can be really simple. Copyright 2012 Ed Burns, Creative Commons License 5
  6. 6. Computer Programming What are instructions? + = The instructions that make up a computerprogram can be really simple... print “Hello world!” Copyright 2012 Ed Burns, Creative Commons License 6
  7. 7. Computer Programming What are instructions? + =...or very complex. launch “space shuttle” Copyright 2012 Ed Burns, Creative Commons License 7
  8. 8. Computer Programming What are instructions? + = ...or very complex. Instructions are also called statements. Copyright 2012 Ed Burns, Creative Commons License 8
  9. 9. Computer Programming Why are programs special? Since the beginning of humanity, there haveonly ever been five different ways that humanscan store and transmit knowledge! Copyright 2012 Ed Burns, Creative Commons License 9
  10. 10. Computer Programming Why are programs special? Brains From the beginningof humans Copyright 2012 Ed Burns, Creative Commons License 10
  11. 11. Computer Programming Why are programs special? Tools Scientists say3.5 million years ago Copyright 2012 Ed Burns, Creative Commons License 11
  12. 12. Computer Programming Why are programs special? Books 600 yearsago Copyright 2012 Ed Burns, Creative Commons License 12
  13. 13. Computer Programming Why are programs special? Recorded sound and images 152 years ago Copyright 2012 Ed Burns, Creative Commons License 13
  14. 14. Computer Programming Why are programs special? Computer programs 68 years ago Copyright 2012 Ed Burns, Creative Commons License 14
  15. 15. Computer Programming What does a program do? Because computer programs are so special,there are lots of special words to talk aboutthem. The first special word describes what acomputer does with a program. Copyright 2012 Ed Burns, Creative Commons License 15
  16. 16. Computer Programming What does a program do? Copyright 2012 Ed Burns, Creative Commons License 16
  17. 17. Computer Programming What does a program do? It runs. What runs the program? Copyright 2012 Ed Burns, Creative Commons License 17
  18. 18. Computer Programming What does a program do? When a program runs, the computer looks ateach instruction and does what the instructionsays, one instruction at a time. Copyright 2012 Ed Burns, Creative Commons License 18
  19. 19. Computer Programming Who makes programs? A person who writes a computer program iscalled a Programmer. You can be a programmer too! Copyright 2012 Ed Burns, Creative Commons License 19
  20. 20. Computer Programming Who makes programs? A person who writes a computer program iscalled a Programmer. You can be a programmer too! Let’s get started! Copyright 2012 Ed Burns, Creative Commons License 20
  21. 21. Computer ProgrammingGetting Started With Programming Copyright 2012 Ed Burns, Creative Commons License 21
  22. 22. Computer Programming Simple instructionsFive basic concepts Variables If and if else statements Lists Loops Sub-routines Copyright 2012 Ed Burns, Creative Commons License 22
  23. 23. Computer Programming Simple instructionsvariable A place to store information so the computercan work with itReal world example: What’s for lunch? Hot dog Hamburger Copyright 2012 Ed Burns, Creative Commons License 23
  24. 24. Computer Programming Simple instructionsvariable A place to store information so the computercan work with it Programming example: What’s for lunch?lunch = “Hot Dog”;lunch = “Hamburger”; Copyright 2012 Ed Burns, Creative Commons License 24
  25. 25. Computer Programming Simple instructionsifMake choices based on the value of a variable Real world example:If lunch is hamburger, get ketchup. If lunch ishot dog, get mustard. Copyright 2012 Ed Burns, Creative Commons License 25
  26. 26. Computer Programming Simple instructions if Make choices based on the value of a variable Programming example:if (lunch.equals(“Hamburger”)) { getKetchup();}if (lunch.equals(“Hot Dog”)) { getMustard();} Copyright 2012 Ed Burns, Creative Commons License 26
  27. 27. Computer Programming Simple instructionsif else Use when you only have two choices to choosefrom. Real world example:If lunch is hamburger, get ketchup, otherwise,get mustard. Copyright 2012 Ed Burns, Creative Commons License 27
  28. 28. Computer Programming Simple instructions if else Use when you only have two choices to choosefrom. Programming example:if (lunch.equals(“Hamburger”)) { getKetchup();} else { getMustard();} Copyright 2012 Ed Burns, Creative Commons License 28
  29. 29. Computer Programming Simple instructionslists A special kind of variable that holds a list ofvalues Real world example:Your lunch choices are: hamburger, hot dog,chicken nuggets or green salad The items in the list are called elements. Thelunch choices list has four elements. Copyright 2012 Ed Burns, Creative Commons License 29
  30. 30. Computer Programminglists Simple instructions A special kind of variable that holds a list ofvalues Programming example:lunchChoices = { “hamburger”, “hot dog”,“chicken nuggets”, “green salad” };print lunchChoices.size();Prints out “4”. Copyright 2012 Ed Burns, Creative Commons License 30
  31. 31. Computer Programming Simple instructionsloops A statement that lets you do something witheach element in a list. Real world example:Look at the lunch menu and decide what to eat. Copyright 2012 Ed Burns, Creative Commons License 31
  32. 32. Computer Programming Simple instructionsloops A statement that lets you do something witheach element in a list. Programming example:for each (item : lunchChoices) { if (iLikeIt(item)) { eat(item); }} Copyright 2012 Ed Burns, Creative Commons License 32
  33. 33. Computer Programming Simple instructions Subroutines A program within a program. Basically a wayto organize your program so it’s easier to read. Real world example:To eat lunch, you must:  Decide what to eat  Buy it  Take it to your table  Eat it. Copyright 2012 Ed Burns, Creative Commons License 33
  34. 34. Computer Programming Simple instructionsSubroutines A program within a program. Basically a wayto organize your program so it’s easier to read. Programming example:lunch = readMenuAndPickItem();buyItem(lunch);table = chooseTable();eatLunchAtTable(lunch, table); Copyright 2012 Ed Burns, Creative Commons License 34
  35. 35. Computer Programming Simple instructionsSubroutines Programming example:lunch = readMenuAndPickItem();buyItem(lunch);table = chooseTable();eatLunchAtTable(lunch, table); Subroutines need information to get their workdone. The pieces of information given to asubroutine are called arguments. Copyright 2012 Ed Burns, Creative Commons License 35
  36. 36. Computer Programming Simple instructions ReviewFive basic concepts Variables If and if else statements Lists Loops Sub-routines Copyright 2012 Ed Burns, Creative Commons License 36
  37. 37. Computer ProgrammingEd Burns, Oracle Corporation Copyright 2012 Ed Burns, Creative Commons License 37

×