SlideShare a Scribd company logo
Today's Computing Challenge
• Challenge One: Identify Else If statements in a piece of code
and understand why they are used.
• Challenge Two: Apply an Else IF statement to a piece of code.
• Aspire Three: To nest If statements into the lesson code to
increase complexity. Apply different IF statements into the
defined problem.
*Additional Extension create your own decision tree including description
and comments into the code hint: use // for code comments
Else IF Statements
• In the last lesson we created a basic program that …..?
• Can you remember?
• The first part of the lesson was to create a simple
If (condition is true){
Then output a message
} else do this
IF Statements - Recap
Java CodeDrawing of a descision
Else If adds more possibilities or choices
Java Code
Start a new java application in
Netbeans and call it esleif
Notice that we did not print out the
grade until after the If statement
block. This is because the result is
assigned to the variable grade until
the end.
Extension: Can you include some
help for the user in the output
window?
Your turn! Adapt the code and expand!
Include more ELSE IF statements to complete the grading system
Once complete take a print screen and upload
to your OneNote.
Can you adapt the code to become
more user friendly!
Can you add comments to your code to explain the process?
Take new screen shot and upload to OneNote
Your turn! Adapt the code and expand!
Can you adapt the code and create a new app
called ‘temperature’
Change the Grades to the following
1. Steaming hot = temperature above 92 degrees Celsius
2. Very hot = temperature above 72 degrees Celsius
3. Hot = temperature above 62 degrees Celsius
4. Very Warm = temperature above 42 degrees Celsius
5. Warm = temperature above 22 degrees Celsius
6. Cold = temperature above 2 degrees Celsius
Plenary
• What variables did you create?
• How did you declare that variable in Java?
• Inside the If statement what does the >= mean?

More Related Content

Similar to Else if statements

Switch statement
Switch statementSwitch statement
Switch statement
Patrick John McGee
 
Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programming
Hamad Odhabi
 
Cis 170 i lab 2 of 7
Cis 170 i lab 2 of 7Cis 170 i lab 2 of 7
Cis 170 i lab 2 of 7helpido9
 
PRG 420 Entire Course NEW
PRG 420 Entire Course NEWPRG 420 Entire Course NEW
PRG 420 Entire Course NEW
shyamuopuoptwelve
 
Cis 170 ilab 2 of 7
Cis 170 ilab 2 of 7Cis 170 ilab 2 of 7
Cis 170 ilab 2 of 7comp274
 
Cis 170 ilab 2 of 7
Cis 170 ilab 2 of 7Cis 170 ilab 2 of 7
Cis 170 ilab 2 of 7
solutionjug4
 
PRG 420 Education Counseling / prg420.com
PRG 420 Education Counseling / prg420.comPRG 420 Education Counseling / prg420.com
PRG 420 Education Counseling / prg420.com
kopiko76
 
PRG 420 Inspiring Innovation--prg420.com
PRG 420 Inspiring Innovation--prg420.comPRG 420 Inspiring Innovation--prg420.com
PRG 420 Inspiring Innovation--prg420.com
kopiko112
 
It feedback answers by jz q 51 100
It feedback answers by jz q 51 100It feedback answers by jz q 51 100
It feedback answers by jz q 51 100
ZeesshhiiStudyPortal
 
PRG 420 Education for Service--prg420.com
PRG 420 Education for Service--prg420.comPRG 420 Education for Service--prg420.com
PRG 420 Education for Service--prg420.com
williamwordsworth25
 
Compiling With Eclipse
Compiling With EclipseCompiling With Eclipse
Compiling With Eclipse
satriahelmy
 
CMIS 102 Entire Course NEW
CMIS 102 Entire Course NEWCMIS 102 Entire Course NEW
CMIS 102 Entire Course NEW
shyamuopuop
 
unacademy teaching internship demo presentation
unacademy teaching  internship demo presentationunacademy teaching  internship demo presentation
unacademy teaching internship demo presentation
codefast
 
PRG 420 NERD Education Counseling--prg420nerd.com
PRG 420 NERD Education Counseling--prg420nerd.comPRG 420 NERD Education Counseling--prg420nerd.com
PRG 420 NERD Education Counseling--prg420nerd.com
venkat60044
 
Development and test infrastructure
Development and test infrastructureDevelopment and test infrastructure
Development and test infrastructure
Jun Li
 
PRG 420 NERD Become Exceptional--prg420nerd.com
PRG 420 NERD Become Exceptional--prg420nerd.comPRG 420 NERD Become Exceptional--prg420nerd.com
PRG 420 NERD Become Exceptional--prg420nerd.com
agathachristie127
 
First steps in Test Driven Development
First steps in Test Driven Development First steps in Test Driven Development
First steps in Test Driven Development
IIBA UK Chapter
 
iOS Development at Scale @Chegg
iOS Development at Scale @CheggiOS Development at Scale @Chegg
iOS Development at Scale @Chegg
GalOrlanczyk
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Elad Elrom
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010
guest5639fa9
 

Similar to Else if statements (20)

Switch statement
Switch statementSwitch statement
Switch statement
 
Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programming
 
Cis 170 i lab 2 of 7
Cis 170 i lab 2 of 7Cis 170 i lab 2 of 7
Cis 170 i lab 2 of 7
 
PRG 420 Entire Course NEW
PRG 420 Entire Course NEWPRG 420 Entire Course NEW
PRG 420 Entire Course NEW
 
Cis 170 ilab 2 of 7
Cis 170 ilab 2 of 7Cis 170 ilab 2 of 7
Cis 170 ilab 2 of 7
 
Cis 170 ilab 2 of 7
Cis 170 ilab 2 of 7Cis 170 ilab 2 of 7
Cis 170 ilab 2 of 7
 
PRG 420 Education Counseling / prg420.com
PRG 420 Education Counseling / prg420.comPRG 420 Education Counseling / prg420.com
PRG 420 Education Counseling / prg420.com
 
PRG 420 Inspiring Innovation--prg420.com
PRG 420 Inspiring Innovation--prg420.comPRG 420 Inspiring Innovation--prg420.com
PRG 420 Inspiring Innovation--prg420.com
 
It feedback answers by jz q 51 100
It feedback answers by jz q 51 100It feedback answers by jz q 51 100
It feedback answers by jz q 51 100
 
PRG 420 Education for Service--prg420.com
PRG 420 Education for Service--prg420.comPRG 420 Education for Service--prg420.com
PRG 420 Education for Service--prg420.com
 
Compiling With Eclipse
Compiling With EclipseCompiling With Eclipse
Compiling With Eclipse
 
CMIS 102 Entire Course NEW
CMIS 102 Entire Course NEWCMIS 102 Entire Course NEW
CMIS 102 Entire Course NEW
 
unacademy teaching internship demo presentation
unacademy teaching  internship demo presentationunacademy teaching  internship demo presentation
unacademy teaching internship demo presentation
 
PRG 420 NERD Education Counseling--prg420nerd.com
PRG 420 NERD Education Counseling--prg420nerd.comPRG 420 NERD Education Counseling--prg420nerd.com
PRG 420 NERD Education Counseling--prg420nerd.com
 
Development and test infrastructure
Development and test infrastructureDevelopment and test infrastructure
Development and test infrastructure
 
PRG 420 NERD Become Exceptional--prg420nerd.com
PRG 420 NERD Become Exceptional--prg420nerd.comPRG 420 NERD Become Exceptional--prg420nerd.com
PRG 420 NERD Become Exceptional--prg420nerd.com
 
First steps in Test Driven Development
First steps in Test Driven Development First steps in Test Driven Development
First steps in Test Driven Development
 
iOS Development at Scale @Chegg
iOS Development at Scale @CheggiOS Development at Scale @Chegg
iOS Development at Scale @Chegg
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010
 

More from Patrick John McGee

Hyperlocal news
Hyperlocal newsHyperlocal news
Hyperlocal news
Patrick John McGee
 
#MOBWOT
#MOBWOT#MOBWOT
Web of Things at Liverpool MakeFest
Web of Things at Liverpool MakeFestWeb of Things at Liverpool MakeFest
Web of Things at Liverpool MakeFest
Patrick John McGee
 
Lesson 10 digital and analogue signals
Lesson 10 digital and analogue signalsLesson 10 digital and analogue signals
Lesson 10 digital and analogue signals
Patrick John McGee
 
Lesson 9 compression - Audio
Lesson 9 compression - AudioLesson 9 compression - Audio
Lesson 9 compression - Audio
Patrick John McGee
 
Lesson 8 Encryption
Lesson 8 EncryptionLesson 8 Encryption
Lesson 8 Encryption
Patrick John McGee
 
Lesson 3 teacher version
Lesson 3 teacher versionLesson 3 teacher version
Lesson 3 teacher version
Patrick John McGee
 
Operating online lesson 2
Operating online lesson 2Operating online lesson 2
Operating online lesson 2
Patrick John McGee
 
Regulations and Legislation for E-Commerce in the UK
Regulations and Legislation for E-Commerce in the UKRegulations and Legislation for E-Commerce in the UK
Regulations and Legislation for E-Commerce in the UK
Patrick John McGee
 
Introduction to scratch programming
Introduction to scratch programmingIntroduction to scratch programming
Introduction to scratch programming
Patrick John McGee
 
Mozilla Open Badges Workshop - Super learners Week @ Irlam & Cadishead College
Mozilla Open Badges Workshop - Super learners Week @ Irlam & Cadishead CollegeMozilla Open Badges Workshop - Super learners Week @ Irlam & Cadishead College
Mozilla Open Badges Workshop - Super learners Week @ Irlam & Cadishead College
Patrick John McGee
 
Do a Bit and achieve a lot!
Do a Bit and achieve a lot!Do a Bit and achieve a lot!
Do a Bit and achieve a lot!
Patrick John McGee
 
Mozilla Open Badges and Digital Inclusion
Mozilla Open Badges and Digital InclusionMozilla Open Badges and Digital Inclusion
Mozilla Open Badges and Digital Inclusion
Patrick John McGee
 
Volunteer Centre BWF Mozilla Open Badges Initial Information Sessions
Volunteer Centre BWF Mozilla Open Badges Initial Information SessionsVolunteer Centre BWF Mozilla Open Badges Initial Information Sessions
Volunteer Centre BWF Mozilla Open Badges Initial Information Sessions
Patrick John McGee
 
Open Badges
Open BadgesOpen Badges
Open Badges
Patrick John McGee
 

More from Patrick John McGee (15)

Hyperlocal news
Hyperlocal newsHyperlocal news
Hyperlocal news
 
#MOBWOT
#MOBWOT#MOBWOT
#MOBWOT
 
Web of Things at Liverpool MakeFest
Web of Things at Liverpool MakeFestWeb of Things at Liverpool MakeFest
Web of Things at Liverpool MakeFest
 
Lesson 10 digital and analogue signals
Lesson 10 digital and analogue signalsLesson 10 digital and analogue signals
Lesson 10 digital and analogue signals
 
Lesson 9 compression - Audio
Lesson 9 compression - AudioLesson 9 compression - Audio
Lesson 9 compression - Audio
 
Lesson 8 Encryption
Lesson 8 EncryptionLesson 8 Encryption
Lesson 8 Encryption
 
Lesson 3 teacher version
Lesson 3 teacher versionLesson 3 teacher version
Lesson 3 teacher version
 
Operating online lesson 2
Operating online lesson 2Operating online lesson 2
Operating online lesson 2
 
Regulations and Legislation for E-Commerce in the UK
Regulations and Legislation for E-Commerce in the UKRegulations and Legislation for E-Commerce in the UK
Regulations and Legislation for E-Commerce in the UK
 
Introduction to scratch programming
Introduction to scratch programmingIntroduction to scratch programming
Introduction to scratch programming
 
Mozilla Open Badges Workshop - Super learners Week @ Irlam & Cadishead College
Mozilla Open Badges Workshop - Super learners Week @ Irlam & Cadishead CollegeMozilla Open Badges Workshop - Super learners Week @ Irlam & Cadishead College
Mozilla Open Badges Workshop - Super learners Week @ Irlam & Cadishead College
 
Do a Bit and achieve a lot!
Do a Bit and achieve a lot!Do a Bit and achieve a lot!
Do a Bit and achieve a lot!
 
Mozilla Open Badges and Digital Inclusion
Mozilla Open Badges and Digital InclusionMozilla Open Badges and Digital Inclusion
Mozilla Open Badges and Digital Inclusion
 
Volunteer Centre BWF Mozilla Open Badges Initial Information Sessions
Volunteer Centre BWF Mozilla Open Badges Initial Information SessionsVolunteer Centre BWF Mozilla Open Badges Initial Information Sessions
Volunteer Centre BWF Mozilla Open Badges Initial Information Sessions
 
Open Badges
Open BadgesOpen Badges
Open Badges
 

Recently uploaded

Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 

Recently uploaded (20)

Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 

Else if statements

  • 1.
  • 2. Today's Computing Challenge • Challenge One: Identify Else If statements in a piece of code and understand why they are used. • Challenge Two: Apply an Else IF statement to a piece of code. • Aspire Three: To nest If statements into the lesson code to increase complexity. Apply different IF statements into the defined problem. *Additional Extension create your own decision tree including description and comments into the code hint: use // for code comments
  • 3. Else IF Statements • In the last lesson we created a basic program that …..? • Can you remember? • The first part of the lesson was to create a simple If (condition is true){ Then output a message } else do this
  • 4. IF Statements - Recap Java CodeDrawing of a descision
  • 5. Else If adds more possibilities or choices
  • 6. Java Code Start a new java application in Netbeans and call it esleif Notice that we did not print out the grade until after the If statement block. This is because the result is assigned to the variable grade until the end. Extension: Can you include some help for the user in the output window?
  • 7. Your turn! Adapt the code and expand! Include more ELSE IF statements to complete the grading system Once complete take a print screen and upload to your OneNote. Can you adapt the code to become more user friendly! Can you add comments to your code to explain the process? Take new screen shot and upload to OneNote
  • 8. Your turn! Adapt the code and expand! Can you adapt the code and create a new app called ‘temperature’ Change the Grades to the following 1. Steaming hot = temperature above 92 degrees Celsius 2. Very hot = temperature above 72 degrees Celsius 3. Hot = temperature above 62 degrees Celsius 4. Very Warm = temperature above 42 degrees Celsius 5. Warm = temperature above 22 degrees Celsius 6. Cold = temperature above 2 degrees Celsius
  • 9. Plenary • What variables did you create? • How did you declare that variable in Java? • Inside the If statement what does the >= mean?