SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
Front-End Web
Development
Lesson 6
Introduction to Programming
Agenda
●
●
●
●
●
●
●

Review (10 minutes)
Team Presentations (20 minutes)
Intro to Programming (10 minutes)
Pseudo Code(20 minutes)
Examples: Thermostat & Pasta (40 minutes)
Boston Temperature (20 minutes)
Lab: Pizza Ordering (45 minutes)
Where We Are
We have developed an understanding of the
following technologies:
HTML5
CSS
The final front-end development technology:
JavaScript
What is a Program?
A program is a set of instructions to tell a
computer what to do
A computer will only do what you tell it to do.
What is Programming?
Programming is the task of writing those
instructions in a language that the computer
can understand.
Becoming a Programmer
It isn’t about the programming language. It is
about changing how you think.
We have to know how the computer thinks to
change how we think.
How Computers “Think”
The short answer is that they don’t think.
Computers act as if they think by sequentially
executing simple instructions.
The only things a computer know are the things
we tell it.
Pseudo Code
Pseudo code is the process of writing a
program without using the syntax of a
programming language
Pseudo Code
Example #1:
If the door is closed and I want to exit the room,
then open the door.
Pseudo Code
Example #1:
If the door is closed and I want to exit the
room, then open the door.
Pseudo Code
Example #1:
If (door is closed and I want to exit the room) {
open the door
}
Pseudo Code
Example #2 (Thermostat)
Outline pseudo code for an application that
would monitor the room temperature and adjust
it so that the room remains a certain
temperature.
Pseudo Code
Example #2 (Thermostat -- in English)
get the temperature
set the target temperature to 72 degrees
repeat these steps:
get the current temperature
if target temperature > (current temperature + 5), then
turn on the heater
if target_temperature <= current temperature, then
turn off the heater
Pseudo Code
Example #2 (Thermostat -- more code-like)
get target_temprature
target_temperature = 72
repeat forever,
current_temperature = get_sensor_reading
if target_temperature > (current_temperature + 5),
turn_on_heater
if target_temperature <= current_temperature,
turn_off_heater
Flow Control
JavaScript is programming
Programming is simply a series of instructions
~ think recipe
Flow Control
Sometimes the ingredients change
~ variables
Sometimes steps are repeated
~ loop
Flow Control
Sometimes steps are changed or omitted
~ conditional statements
Sometimes instructions are common to several
recipes
~ function
Pseudo Code
Simply explain what you want to happen in
plain English
Example #3 (Recipe)
~ explain how to make pasta
Pseudo Code
Step 1: assemble ingredients
Step 2: boil water
Step 3: add pasta
Step 4: heat pasta sauce
Step 5: combine pasta and sauce
Step 6: serve
Programming Concepts
variables: [ingredients]
loops : [repeated steps]
conditionals: [if one thing, then do something]
functions: [mini-programs]
Whiteboard
Build out pseudo code for making pasta.
What Can JavaScript Do?
Let’s look at a web page example:
~ Google “weather Boston”
What Can JavaScript Do?
variables: [ingredients] ???
loops: [repeated steps] ???
conditionals: [if one thing, then do something] ???
functions: [mini-programs] ???
Lab
Create pseudo code for the process of ordering
pizza.
Whiteboard the basics.
Work in teams of three.
Homework
Watch What Can You Do with JavaScript?
Research Chrome Developer Tools
Create index page for your server workspace

Contenu connexe

Similaire à Lesson 06

L1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfL1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfMMRF2
 
System integration through queues
System integration through queuesSystem integration through queues
System integration through queuesGianluca Padovani
 
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
Week 2PRG 218   Variables and Input and Output OperationsWrite.docxWeek 2PRG 218   Variables and Input and Output OperationsWrite.docx
Week 2PRG 218 Variables and Input and Output OperationsWrite.docxmelbruce90096
 
TOPIC-1-Introduction and Preliminaries.pdf
TOPIC-1-Introduction and Preliminaries.pdfTOPIC-1-Introduction and Preliminaries.pdf
TOPIC-1-Introduction and Preliminaries.pdfEjazAlam23
 
Programs_Problem_Solving_Algorithms.ppt
Programs_Problem_Solving_Algorithms.pptPrograms_Problem_Solving_Algorithms.ppt
Programs_Problem_Solving_Algorithms.pptmalik681299
 
Devry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menuDevry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menunoahjamessss
 
Devry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menuDevry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menucskvsmi44
 
MITx 6.00.1x Introduction to Computer Science and Programming Using Python - ...
MITx 6.00.1x Introduction to Computer Science and Programming Using Python - ...MITx 6.00.1x Introduction to Computer Science and Programming Using Python - ...
MITx 6.00.1x Introduction to Computer Science and Programming Using Python - ...Dylan-Wu
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartdipti reya
 
AIS Technical Development Workshop 3: Getting Started with Git and GitHub
AIS Technical Development Workshop 3: Getting Started with Git and GitHubAIS Technical Development Workshop 3: Getting Started with Git and GitHub
AIS Technical Development Workshop 3: Getting Started with Git and GitHubNhi Nguyen
 
TDD Mini Workshop @ Bucharest JUG 2014 04 24
TDD Mini Workshop @ Bucharest JUG 2014 04 24TDD Mini Workshop @ Bucharest JUG 2014 04 24
TDD Mini Workshop @ Bucharest JUG 2014 04 24Adi Bolboaca
 
TDD BDD PHP - Sviluppo guidato dai test in PHP con phpspec
TDD BDD PHP - Sviluppo guidato dai test in PHP con phpspecTDD BDD PHP - Sviluppo guidato dai test in PHP con phpspec
TDD BDD PHP - Sviluppo guidato dai test in PHP con phpspecPatrick Luca Fazzi
 
Logika dan Algoritma pemrograman
Logika dan Algoritma pemrogramanLogika dan Algoritma pemrograman
Logika dan Algoritma pemrogramanArif Huda
 

Similaire à Lesson 06 (20)

Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Pyramid of-developer-skills
Pyramid of-developer-skillsPyramid of-developer-skills
Pyramid of-developer-skills
 
L1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfL1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdf
 
01 Programming Fundamentals.pptx
01 Programming Fundamentals.pptx01 Programming Fundamentals.pptx
01 Programming Fundamentals.pptx
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
System integration through queues
System integration through queuesSystem integration through queues
System integration through queues
 
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
Week 2PRG 218   Variables and Input and Output OperationsWrite.docxWeek 2PRG 218   Variables and Input and Output OperationsWrite.docx
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
 
TOPIC-1-Introduction and Preliminaries.pdf
TOPIC-1-Introduction and Preliminaries.pdfTOPIC-1-Introduction and Preliminaries.pdf
TOPIC-1-Introduction and Preliminaries.pdf
 
part_1 (1).ppt
part_1 (1).pptpart_1 (1).ppt
part_1 (1).ppt
 
Programs_Problem_Solving_Algorithms.ppt
Programs_Problem_Solving_Algorithms.pptPrograms_Problem_Solving_Algorithms.ppt
Programs_Problem_Solving_Algorithms.ppt
 
Week 1
Week 1Week 1
Week 1
 
Devry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menuDevry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menu
 
Devry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menuDevry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menu
 
MITx 6.00.1x Introduction to Computer Science and Programming Using Python - ...
MITx 6.00.1x Introduction to Computer Science and Programming Using Python - ...MITx 6.00.1x Introduction to Computer Science and Programming Using Python - ...
MITx 6.00.1x Introduction to Computer Science and Programming Using Python - ...
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
AIS Technical Development Workshop 3: Getting Started with Git and GitHub
AIS Technical Development Workshop 3: Getting Started with Git and GitHubAIS Technical Development Workshop 3: Getting Started with Git and GitHub
AIS Technical Development Workshop 3: Getting Started with Git and GitHub
 
TDD Mini Workshop @ Bucharest JUG 2014 04 24
TDD Mini Workshop @ Bucharest JUG 2014 04 24TDD Mini Workshop @ Bucharest JUG 2014 04 24
TDD Mini Workshop @ Bucharest JUG 2014 04 24
 
TDD BDD PHP - Sviluppo guidato dai test in PHP con phpspec
TDD BDD PHP - Sviluppo guidato dai test in PHP con phpspecTDD BDD PHP - Sviluppo guidato dai test in PHP con phpspec
TDD BDD PHP - Sviluppo guidato dai test in PHP con phpspec
 
Write tests, please
Write tests, pleaseWrite tests, please
Write tests, please
 
Logika dan Algoritma pemrograman
Logika dan Algoritma pemrogramanLogika dan Algoritma pemrograman
Logika dan Algoritma pemrograman
 

Plus de Gene Babon

Job Search | Tropical Depressions | Bowling Alleys
Job Search | Tropical Depressions | Bowling AlleysJob Search | Tropical Depressions | Bowling Alleys
Job Search | Tropical Depressions | Bowling AlleysGene Babon
 
Tech Over Fifty Launch Meeting
Tech Over Fifty Launch MeetingTech Over Fifty Launch Meeting
Tech Over Fifty Launch MeetingGene Babon
 
Anatomy Virtual Self Study Group NEPHP 2018
Anatomy Virtual Self Study Group NEPHP 2018Anatomy Virtual Self Study Group NEPHP 2018
Anatomy Virtual Self Study Group NEPHP 2018Gene Babon
 
Become a Front End Web Developer
Become a Front End Web DeveloperBecome a Front End Web Developer
Become a Front End Web DeveloperGene Babon
 
Navigating a Career in Web Technology
Navigating a Career in Web TechnologyNavigating a Career in Web Technology
Navigating a Career in Web TechnologyGene Babon
 
Getting Things Done
Getting Things DoneGetting Things Done
Getting Things DoneGene Babon
 
jQuery Mobile Hour 4
jQuery Mobile Hour 4jQuery Mobile Hour 4
jQuery Mobile Hour 4Gene Babon
 

Plus de Gene Babon (20)

Job Search | Tropical Depressions | Bowling Alleys
Job Search | Tropical Depressions | Bowling AlleysJob Search | Tropical Depressions | Bowling Alleys
Job Search | Tropical Depressions | Bowling Alleys
 
Tech Over Fifty Launch Meeting
Tech Over Fifty Launch MeetingTech Over Fifty Launch Meeting
Tech Over Fifty Launch Meeting
 
Anatomy Virtual Self Study Group NEPHP 2018
Anatomy Virtual Self Study Group NEPHP 2018Anatomy Virtual Self Study Group NEPHP 2018
Anatomy Virtual Self Study Group NEPHP 2018
 
Become a Front End Web Developer
Become a Front End Web DeveloperBecome a Front End Web Developer
Become a Front End Web Developer
 
Navigating a Career in Web Technology
Navigating a Career in Web TechnologyNavigating a Career in Web Technology
Navigating a Career in Web Technology
 
Info Session
Info SessionInfo Session
Info Session
 
Info session
Info sessionInfo session
Info session
 
Getting Things Done
Getting Things DoneGetting Things Done
Getting Things Done
 
jQuery Mobile Hour 4
jQuery Mobile Hour 4jQuery Mobile Hour 4
jQuery Mobile Hour 4
 
Lesson 17
Lesson 17Lesson 17
Lesson 17
 
Lesson 18
Lesson 18Lesson 18
Lesson 18
 
Lesson 17
Lesson 17Lesson 17
Lesson 17
 
Lesson 16
Lesson 16Lesson 16
Lesson 16
 
Lesson 15
Lesson 15Lesson 15
Lesson 15
 
Lesson 11
Lesson 11Lesson 11
Lesson 11
 
Lesson 10
Lesson 10Lesson 10
Lesson 10
 
Lesson 09
Lesson 09Lesson 09
Lesson 09
 
Lesson 05
Lesson 05Lesson 05
Lesson 05
 
Lesson 04
Lesson 04Lesson 04
Lesson 04
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
 

Dernier

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 

Dernier (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 

Lesson 06

  • 2. Agenda ● ● ● ● ● ● ● Review (10 minutes) Team Presentations (20 minutes) Intro to Programming (10 minutes) Pseudo Code(20 minutes) Examples: Thermostat & Pasta (40 minutes) Boston Temperature (20 minutes) Lab: Pizza Ordering (45 minutes)
  • 3. Where We Are We have developed an understanding of the following technologies: HTML5 CSS The final front-end development technology: JavaScript
  • 4. What is a Program? A program is a set of instructions to tell a computer what to do A computer will only do what you tell it to do.
  • 5. What is Programming? Programming is the task of writing those instructions in a language that the computer can understand.
  • 6. Becoming a Programmer It isn’t about the programming language. It is about changing how you think. We have to know how the computer thinks to change how we think.
  • 7. How Computers “Think” The short answer is that they don’t think. Computers act as if they think by sequentially executing simple instructions. The only things a computer know are the things we tell it.
  • 8. Pseudo Code Pseudo code is the process of writing a program without using the syntax of a programming language
  • 9. Pseudo Code Example #1: If the door is closed and I want to exit the room, then open the door.
  • 10. Pseudo Code Example #1: If the door is closed and I want to exit the room, then open the door.
  • 11. Pseudo Code Example #1: If (door is closed and I want to exit the room) { open the door }
  • 12. Pseudo Code Example #2 (Thermostat) Outline pseudo code for an application that would monitor the room temperature and adjust it so that the room remains a certain temperature.
  • 13. Pseudo Code Example #2 (Thermostat -- in English) get the temperature set the target temperature to 72 degrees repeat these steps: get the current temperature if target temperature > (current temperature + 5), then turn on the heater if target_temperature <= current temperature, then turn off the heater
  • 14. Pseudo Code Example #2 (Thermostat -- more code-like) get target_temprature target_temperature = 72 repeat forever, current_temperature = get_sensor_reading if target_temperature > (current_temperature + 5), turn_on_heater if target_temperature <= current_temperature, turn_off_heater
  • 15. Flow Control JavaScript is programming Programming is simply a series of instructions ~ think recipe
  • 16. Flow Control Sometimes the ingredients change ~ variables Sometimes steps are repeated ~ loop
  • 17. Flow Control Sometimes steps are changed or omitted ~ conditional statements Sometimes instructions are common to several recipes ~ function
  • 18. Pseudo Code Simply explain what you want to happen in plain English Example #3 (Recipe) ~ explain how to make pasta
  • 19. Pseudo Code Step 1: assemble ingredients Step 2: boil water Step 3: add pasta Step 4: heat pasta sauce Step 5: combine pasta and sauce Step 6: serve
  • 20. Programming Concepts variables: [ingredients] loops : [repeated steps] conditionals: [if one thing, then do something] functions: [mini-programs]
  • 21. Whiteboard Build out pseudo code for making pasta.
  • 22. What Can JavaScript Do? Let’s look at a web page example: ~ Google “weather Boston”
  • 23. What Can JavaScript Do? variables: [ingredients] ??? loops: [repeated steps] ??? conditionals: [if one thing, then do something] ??? functions: [mini-programs] ???
  • 24. Lab Create pseudo code for the process of ordering pizza. Whiteboard the basics. Work in teams of three.
  • 25. Homework Watch What Can You Do with JavaScript? Research Chrome Developer Tools Create index page for your server workspace