SlideShare a Scribd company logo
Computer Programming




Ed Burns, Oracle Corporation
Computer Programming
                 What is a program?





 A computer program is a file, just like a
document in Microsoft Word or a picture in
KidPix.



               Copyright 2012 Ed Burns, Creative Commons License   2
Computer Programming
                  What is a program?

        +        =





 With Microsoft Word or KidPix you use the
computer to create text or images to be read or
viewed by humans.

            +        =


                Copyright 2012 Ed Burns, Creative Commons License   3
Computer Programming
                  What is a program?

        +        =





 With a computer program, you use the
computer to create instructions to be read by a
computer!



                Copyright 2012 Ed Burns, Creative Commons License   4
Computer Programming
               What are instructions?

       +        =




 The instructions that make up a computer
program can be really simple.




               Copyright 2012 Ed Burns, Creative Commons License   5
Computer Programming
                What are instructions?

        +        =




 The instructions that make up a computer
program can be really simple...



    print “Hello world!”


                Copyright 2012 Ed Burns, Creative Commons License   6
Computer Programming
                What are instructions?

        +        =




...or very complex.






    launch “space shuttle”



                Copyright 2012 Ed Burns, Creative Commons License   7
Computer Programming
                What are instructions?

        +        =





 ...or very complex.

 Instructions are also called statements.




                Copyright 2012 Ed Burns, Creative Commons License   8
Computer Programming
             Why are programs special?





 Since the beginning of humanity, there have
only ever been five different ways that humans
can store and transmit knowledge!



               Copyright 2012 Ed Burns, Creative Commons License   9
Computer Programming
            Why are programs special?





 Brains

 From the beginning
of humans



              Copyright 2012 Ed Burns, Creative Commons License   10
Computer Programming
             Why are programs special?





 Tools

 Scientists say
3.5 million years ago



               Copyright 2012 Ed Burns, Creative Commons License   11
Computer Programming
             Why are programs special?





 Books

 600 years
ago



               Copyright 2012 Ed Burns, Creative Commons License   12
Computer Programming
           Why are programs special?





 Recorded sound and images

 152 years ago




             Copyright 2012 Ed Burns, Creative Commons License   13
Computer Programming
           Why are programs special?





 Computer programs

 68 years ago




             Copyright 2012 Ed Burns, Creative Commons License   14
Computer Programming
             What does a program do?





  Because computer programs are so special,
there are lots of special words to talk about
them.

 The first special word describes what a
computer does with a program.


               Copyright 2012 Ed Burns, Creative Commons License   15
Computer Programming
   What does a program do?




    Copyright 2012 Ed Burns, Creative Commons License   16
Computer Programming
            What does a program do?





 It runs.

 What runs the program?


              Copyright 2012 Ed Burns, Creative Commons License   17
Computer Programming
             What does a program do?





 When a program runs, the computer looks at
each instruction and does what the instruction
says, one instruction at a time.

               Copyright 2012 Ed Burns, Creative Commons License   18
Computer Programming
              Who makes programs?





 A person who writes a computer program is
called a Programmer.

 You can be a programmer too!



              Copyright 2012 Ed Burns, Creative Commons License   19
Computer Programming
              Who makes programs?





 A person who writes a computer program is
called a Programmer.

 You can be a programmer too!

 Let’s get started!



              Copyright 2012 Ed Burns, Creative Commons License   20
Computer Programming




Getting Started With Programming
          Copyright 2012 Ed Burns, Creative Commons License   21
Computer Programming
                  Simple instructions




Five basic concepts



  Variables

  If and if else statements

  Lists

  Loops

  Sub-routines


               Copyright 2012 Ed Burns, Creative Commons License   22
Computer Programming
                  Simple instructions


variable





 A place to store information so the computer
can work with it

Real world example: What’s for lunch?



  Hot dog

  Hamburger
               Copyright 2012 Ed Burns, Creative Commons License   23
Computer Programming
                  Simple instructions


variable





 A place to store information so the computer
can work with it

 Programming example: What’s for lunch?
lunch = “Hot Dog”;
lunch = “Hamburger”;
               Copyright 2012 Ed Burns, Creative Commons License   24
Computer Programming
                   Simple instructions



if





Make choices based on the value of a variable





 Real world example:
If lunch is hamburger, get ketchup. If lunch is
hot dog, get mustard.

                Copyright 2012 Ed Burns, Creative Commons License   25
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
Computer Programming
                  Simple instructions


if else





 Use when you only have two choices to choose
from.

 Real world example:
If lunch is hamburger, get ketchup, otherwise,
get mustard.
               Copyright 2012 Ed Burns, Creative Commons License   27
Computer Programming
                       Simple instructions

 if else

 Use when you only have two choices to choose
from.

 Programming example:
if (lunch.equals(“Hamburger”)) {
   getKetchup();
} else {
   getMustard();
}            Copyright 2012 Ed Burns, Creative Commons License   28
Computer Programming
                   Simple instructions
lists





 A special kind of variable that holds a list of
values

 Real world example:
Your lunch choices are: hamburger, hot dog,
chicken nuggets or green salad

 The items in the list are called elements. The
lunch choices list has four elements.
                Copyright 2012 Ed Burns, Creative Commons License   29
Computer Programming
lists
                    Simple instructions


 A special kind of variable that holds a list of
values

 Programming example:
lunchChoices = { “hamburger”,
   “hot dog”,“chicken nuggets”,
   “green salad” };
print lunchChoices.size();

Prints out “4”.

                  Copyright 2012 Ed Burns, Creative Commons License   30
Computer Programming
                  Simple instructions


loops





 A statement that lets you do something with
each 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
Computer Programming
                  Simple instructions
loops





 A statement that lets you do something with
each element in a list.

 Programming example:
for each (item : lunchChoices) {
   if (iLikeIt(item)) {
     eat(item);
   }
}
               Copyright 2012 Ed Burns, Creative Commons License   32
Computer Programming
                             Simple instructions

 Subroutines

 A program within a program. Basically a way
to 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
Computer Programming
                  Simple instructions
Subroutines





 A program within a program. Basically a way
to 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
Computer Programming
                  Simple instructions
Subroutines





 Programming example:
lunch = readMenuAndPickItem();
buyItem(lunch);
table = chooseTable();
eatLunchAtTable(lunch, table);

 Subroutines need information to get their work
done. The pieces of information given to a
subroutine are called arguments.
               Copyright 2012 Ed Burns, Creative Commons License   35
Computer Programming
                  Simple instructions
                       Review



Five basic concepts



  Variables

  If and if else statements

  Lists

  Loops

  Sub-routines


               Copyright 2012 Ed Burns, Creative Commons License   36
Computer Programming




Ed Burns, Oracle Corporation
       Copyright 2012 Ed Burns, Creative Commons License   37

More Related Content

PPTX
Introduction to Computer Science
Kalpit Jain
 
PDF
scratch course-part1-2023.pdf
Doaa Mohey Eldin
 
PPT
Lect 1. introduction to programming languages
Varun Garg
 
PPTX
What is an algorithm?
Angela DeHart
 
PDF
Ethereum-Cryptocurrency (All about Ethereum)
عطاءالمنعم اثیل شیخ
 
PPTX
Teacher leadership ppt
Universty Of Gujrat, Pakistan
 
PPT
Fundamental of Computers
Dr. Himanshu Gupta
 
PPSX
Computer basic for kids
Paul Gonzales
 
Introduction to Computer Science
Kalpit Jain
 
scratch course-part1-2023.pdf
Doaa Mohey Eldin
 
Lect 1. introduction to programming languages
Varun Garg
 
What is an algorithm?
Angela DeHart
 
Ethereum-Cryptocurrency (All about Ethereum)
عطاءالمنعم اثیل شیخ
 
Teacher leadership ppt
Universty Of Gujrat, Pakistan
 
Fundamental of Computers
Dr. Himanshu Gupta
 
Computer basic for kids
Paul Gonzales
 

What's hot (20)

ODP
Introduction to Python - Training for Kids
Aimee Maree
 
PPTX
Introduction to Coding
St. Petersburg College
 
PPT
Introduction to Scratch Programming
StorytimeSteph
 
PPT
Java tutorial PPT
Intelligo Technologies
 
PDF
Internet programming lecture 1
Mohammed Hussein
 
PDF
Computer Programming
Syed Zaid Irshad
 
PDF
Web Development with HTML5, CSS3 & JavaScript
Edureka!
 
PDF
Report on web development
AJEETKUMAR932614
 
PPTX
Algorithms and Flowcharts
Deva Singh
 
PPT
Programming
Leo Simon Anfone
 
PPTX
Technical Quiz (Basic concepts of computers)
Manpreet Kaur
 
PPT
Python Programming ppt
ismailmrribi
 
PPTX
Coding For Kids
Krupesh Shah
 
PPTX
Web app presentation
zahid6
 
PPTX
What Is Coding And Why Should You Learn It?
Syed Hassan Raza
 
PPT
Programming in c
indra Kishor
 
PPTX
Selected topics in Computer Science
Melaku Bayih Demessie
 
PPTX
IGCSE ICT 0417 P3 Website Authoring using Front Page
Shamir George
 
PDF
Web development ppt
ParasJain222
 
DOCX
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
Rc Os
 
Introduction to Python - Training for Kids
Aimee Maree
 
Introduction to Coding
St. Petersburg College
 
Introduction to Scratch Programming
StorytimeSteph
 
Java tutorial PPT
Intelligo Technologies
 
Internet programming lecture 1
Mohammed Hussein
 
Computer Programming
Syed Zaid Irshad
 
Web Development with HTML5, CSS3 & JavaScript
Edureka!
 
Report on web development
AJEETKUMAR932614
 
Algorithms and Flowcharts
Deva Singh
 
Programming
Leo Simon Anfone
 
Technical Quiz (Basic concepts of computers)
Manpreet Kaur
 
Python Programming ppt
ismailmrribi
 
Coding For Kids
Krupesh Shah
 
Web app presentation
zahid6
 
What Is Coding And Why Should You Learn It?
Syed Hassan Raza
 
Programming in c
indra Kishor
 
Selected topics in Computer Science
Melaku Bayih Demessie
 
IGCSE ICT 0417 P3 Website Authoring using Front Page
Shamir George
 
Web development ppt
ParasJain222
 
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
Rc Os
 
Ad

Similar to Kids computer-programming (20)

PDF
Starting Out With Visual C 2010 2nd Edition Tony Gaddis
qmrgtrus874
 
PPTX
Lavacon12 rethink content paper to tablet
Maxwell Hoffmann
 
PPTX
ch01.pptxygyygyggy ygygygygygygygyggygygyg
jzarzoor
 
PPT
Itroduction about java
srmohan06
 
PPT
An overview of computers and programming languages
Ahmad Idrees
 
PDF
13 Best IDE for Web Development Projects in 2022.pdf
mithranmithran1
 
PPTX
Computer_Programming_Fundamentals in cpp
meharikiros2
 
PDF
[Android] Introduction to Android Programming
Nikmesoft Ltd
 
PPT
Computer appreciation
Olamilekan Adeeko
 
PPT
android Programming with detail slide an
HAIDRIVE
 
PDF
What's in an Android?
Abdallah El Ali
 
PPTX
#2 open source introduction
sscholle
 
PPTX
Learn android app_development(1)_intro
Adel Jaffan
 
PPT
Student pc productivity presentation ppt
Ryan Joyce
 
PPTX
201 how to use the computer
Satoru Hoshiba
 
PDF
17h25_closing_keynote_stefano_stinchi_-_innovation_story.pdf
BrunoAtti1
 
PPT
androidPramming.ppt
BijayKc16
 
PPTX
Latest Android App Development Tools 2019
Elijahj Williams
 
PDF
Training android
University of Technology
 
PDF
Android App Development Intro at ESC SV 2012
Opersys inc.
 
Starting Out With Visual C 2010 2nd Edition Tony Gaddis
qmrgtrus874
 
Lavacon12 rethink content paper to tablet
Maxwell Hoffmann
 
ch01.pptxygyygyggy ygygygygygygygyggygygyg
jzarzoor
 
Itroduction about java
srmohan06
 
An overview of computers and programming languages
Ahmad Idrees
 
13 Best IDE for Web Development Projects in 2022.pdf
mithranmithran1
 
Computer_Programming_Fundamentals in cpp
meharikiros2
 
[Android] Introduction to Android Programming
Nikmesoft Ltd
 
Computer appreciation
Olamilekan Adeeko
 
android Programming with detail slide an
HAIDRIVE
 
What's in an Android?
Abdallah El Ali
 
#2 open source introduction
sscholle
 
Learn android app_development(1)_intro
Adel Jaffan
 
Student pc productivity presentation ppt
Ryan Joyce
 
201 how to use the computer
Satoru Hoshiba
 
17h25_closing_keynote_stefano_stinchi_-_innovation_story.pdf
BrunoAtti1
 
androidPramming.ppt
BijayKc16
 
Latest Android App Development Tools 2019
Elijahj Williams
 
Training android
University of Technology
 
Android App Development Intro at ESC SV 2012
Opersys inc.
 
Ad

More from Edward Burns (20)

PDF
Java and AI with LangChain4j: Jakarta EE gets AI
Edward Burns
 
PDF
Java and AI with LangChain4j: Jakarta EE and AI
Edward Burns
 
PDF
20250403-trusted-ai-favorite-ide-javaland.pdf
Edward Burns
 
PDF
A survey of cloud readiness for Jakarta EE 11
Edward Burns
 
PDF
Java and AI with LangChain4j: Jakarta EE and SmallRye LLM
Edward Burns
 
PDF
Java and AI with LangChain4j: Integrating Jakarta EE and LLMs
Edward Burns
 
PDF
How to get trusted AI in your favorite IDE
Edward Burns
 
PDF
How to get trusted AI in your favorite IDE
Edward Burns
 
PDF
How to get trusted AI in your favorite IDE
Edward Burns
 
PDF
How to get trusted AI in your favorite IDE
Edward Burns
 
PPTX
2024-09-10 Jacksonville JUG Java on Azure with AI
Edward Burns
 
PPTX
Deliver AI infused app innovation with Open Liberty on AKS
Edward Burns
 
PPTX
DevTalks Romania: Prepare for Jakarta EE 11
Edward Burns
 
PDF
Developer Career Masterplan
Edward Burns
 
PPTX
Jakarta EE 11 Status Update​
Edward Burns
 
PDF
Sponsored Session: Please touch that dial!
Edward Burns
 
PDF
How modernizing enterprise applications gives you a competitive advantage
Edward Burns
 
PDF
Wie Azure Jakarta EE Nutzt
Edward Burns
 
PDF
Practical lessons from customers performing digital transformation with Azure
Edward Burns
 
PDF
wls-azure-devnexus-2022.pdf
Edward Burns
 
Java and AI with LangChain4j: Jakarta EE gets AI
Edward Burns
 
Java and AI with LangChain4j: Jakarta EE and AI
Edward Burns
 
20250403-trusted-ai-favorite-ide-javaland.pdf
Edward Burns
 
A survey of cloud readiness for Jakarta EE 11
Edward Burns
 
Java and AI with LangChain4j: Jakarta EE and SmallRye LLM
Edward Burns
 
Java and AI with LangChain4j: Integrating Jakarta EE and LLMs
Edward Burns
 
How to get trusted AI in your favorite IDE
Edward Burns
 
How to get trusted AI in your favorite IDE
Edward Burns
 
How to get trusted AI in your favorite IDE
Edward Burns
 
How to get trusted AI in your favorite IDE
Edward Burns
 
2024-09-10 Jacksonville JUG Java on Azure with AI
Edward Burns
 
Deliver AI infused app innovation with Open Liberty on AKS
Edward Burns
 
DevTalks Romania: Prepare for Jakarta EE 11
Edward Burns
 
Developer Career Masterplan
Edward Burns
 
Jakarta EE 11 Status Update​
Edward Burns
 
Sponsored Session: Please touch that dial!
Edward Burns
 
How modernizing enterprise applications gives you a competitive advantage
Edward Burns
 
Wie Azure Jakarta EE Nutzt
Edward Burns
 
Practical lessons from customers performing digital transformation with Azure
Edward Burns
 
wls-azure-devnexus-2022.pdf
Edward Burns
 

Recently uploaded (20)

PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PPTX
Odoo 18 Sales_ Managing Quotation Validity
Celine George
 
PDF
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
CDH. pptx
AneetaSharma15
 
PDF
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPT
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
PDF
Study Material and notes for Women Empowerment
ComputerScienceSACWC
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
Odoo 18 Sales_ Managing Quotation Validity
Celine George
 
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
CDH. pptx
AneetaSharma15
 
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
Study Material and notes for Women Empowerment
ComputerScienceSACWC
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 

Kids computer-programming

  • 1. Computer Programming Ed Burns, Oracle Corporation
  • 2. Computer Programming What is a program?  A computer program is a file, just like a document in Microsoft Word or a picture in KidPix. Copyright 2012 Ed Burns, Creative Commons License 2
  • 3. Computer Programming What is a program? + =  With Microsoft Word or KidPix you use the computer to create text or images to be read or viewed by humans. + = Copyright 2012 Ed Burns, Creative Commons License 3
  • 4. Computer Programming What is a program? + =  With a computer program, you use the computer to create instructions to be read by a computer! Copyright 2012 Ed Burns, Creative Commons License 4
  • 5. Computer Programming What are instructions? + =  The instructions that make up a computer program can be really simple. Copyright 2012 Ed Burns, Creative Commons License 5
  • 6. Computer Programming What are instructions? + =  The instructions that make up a computer program can be really simple...  print “Hello world!” Copyright 2012 Ed Burns, Creative Commons License 6
  • 7. Computer Programming What are instructions? + = ...or very complex.   launch “space shuttle” Copyright 2012 Ed Burns, Creative Commons License 7
  • 8. Computer Programming What are instructions? + =  ...or very complex.  Instructions are also called statements. Copyright 2012 Ed Burns, Creative Commons License 8
  • 9. Computer Programming Why are programs special?  Since the beginning of humanity, there have only ever been five different ways that humans can store and transmit knowledge! Copyright 2012 Ed Burns, Creative Commons License 9
  • 10. Computer Programming Why are programs special?  Brains  From the beginning of humans Copyright 2012 Ed Burns, Creative Commons License 10
  • 11. Computer Programming Why are programs special?  Tools  Scientists say 3.5 million years ago Copyright 2012 Ed Burns, Creative Commons License 11
  • 12. Computer Programming Why are programs special?  Books  600 years ago Copyright 2012 Ed Burns, Creative Commons License 12
  • 13. Computer Programming Why are programs special?  Recorded sound and images  152 years ago Copyright 2012 Ed Burns, Creative Commons License 13
  • 14. Computer Programming Why are programs special?  Computer programs  68 years ago Copyright 2012 Ed Burns, Creative Commons License 14
  • 15. Computer Programming What does a program do?  Because computer programs are so special, there are lots of special words to talk about them.  The first special word describes what a computer does with a program. Copyright 2012 Ed Burns, Creative Commons License 15
  • 16. Computer Programming What does a program do? Copyright 2012 Ed Burns, Creative Commons License 16
  • 17. Computer Programming What does a program do?  It runs.  What runs the program? Copyright 2012 Ed Burns, Creative Commons License 17
  • 18. Computer Programming What does a program do?  When a program runs, the computer looks at each instruction and does what the instruction says, one instruction at a time. Copyright 2012 Ed Burns, Creative Commons License 18
  • 19. Computer Programming Who makes programs?  A person who writes a computer program is called a Programmer.  You can be a programmer too! Copyright 2012 Ed Burns, Creative Commons License 19
  • 20. Computer Programming Who makes programs?  A person who writes a computer program is called a Programmer.  You can be a programmer too!  Let’s get started! Copyright 2012 Ed Burns, Creative Commons License 20
  • 21. Computer Programming Getting Started With Programming Copyright 2012 Ed Burns, Creative Commons License 21
  • 22. Computer Programming Simple instructions Five basic concepts   Variables  If and if else statements  Lists  Loops  Sub-routines Copyright 2012 Ed Burns, Creative Commons License 22
  • 23. Computer Programming Simple instructions variable   A place to store information so the computer can work with it Real world example: What’s for lunch?   Hot dog  Hamburger Copyright 2012 Ed Burns, Creative Commons License 23
  • 24. Computer Programming Simple instructions variable   A place to store information so the computer can work with it  Programming example: What’s for lunch? lunch = “Hot Dog”; lunch = “Hamburger”; Copyright 2012 Ed Burns, Creative Commons License 24
  • 25. Computer Programming Simple instructions if  Make choices based on the value of a variable   Real world example: If lunch is hamburger, get ketchup. If lunch is hot dog, get mustard. Copyright 2012 Ed Burns, Creative Commons License 25
  • 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. Computer Programming Simple instructions if else   Use when you only have two choices to choose from.  Real world example: If lunch is hamburger, get ketchup, otherwise, get mustard. Copyright 2012 Ed Burns, Creative Commons License 27
  • 28. Computer Programming Simple instructions  if else  Use when you only have two choices to choose from.  Programming example: if (lunch.equals(“Hamburger”)) { getKetchup(); } else { getMustard(); } Copyright 2012 Ed Burns, Creative Commons License 28
  • 29. Computer Programming Simple instructions lists   A special kind of variable that holds a list of values  Real world example: Your lunch choices are: hamburger, hot dog, chicken nuggets or green salad  The items in the list are called elements. The lunch choices list has four elements. Copyright 2012 Ed Burns, Creative Commons License 29
  • 30. Computer Programming lists  Simple instructions  A special kind of variable that holds a list of values  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. Computer Programming Simple instructions loops   A statement that lets you do something with each 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. Computer Programming Simple instructions loops   A statement that lets you do something with each element in a list.  Programming example: for each (item : lunchChoices) { if (iLikeIt(item)) { eat(item); } } Copyright 2012 Ed Burns, Creative Commons License 32
  • 33. Computer Programming Simple instructions  Subroutines  A program within a program. Basically a way to 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. Computer Programming Simple instructions Subroutines   A program within a program. Basically a way to 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. Computer Programming Simple instructions Subroutines   Programming example: lunch = readMenuAndPickItem(); buyItem(lunch); table = chooseTable(); eatLunchAtTable(lunch, table);  Subroutines need information to get their work done. The pieces of information given to a subroutine are called arguments. Copyright 2012 Ed Burns, Creative Commons License 35
  • 36. Computer Programming Simple instructions Review Five basic concepts   Variables  If and if else statements  Lists  Loops  Sub-routines Copyright 2012 Ed Burns, Creative Commons License 36
  • 37. Computer Programming Ed Burns, Oracle Corporation Copyright 2012 Ed Burns, Creative Commons License 37