SlideShare uma empresa Scribd logo
1 de 23
Class 8 – Conditional Logic
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pseudocode Review ,[object Object],[object Object],[object Object],[object Object],[object Object]
Pseudocode in Programs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Flow Chart Notation Review ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sample FlowChart ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],start end Assignment name? Set counter = 1 Counter>10? Calculate Average Print Average Increment Counter Student Grade? Yes No
Conditions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Relational Operators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Consider a=12 b=43 What is the effect on each of the conditions?
Relational Operators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Consider a=12 b=43 What is the effect on each of the conditions? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logical Operators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Consider a=Today is Tuesday b=It is Raining What is the effect on each of the conditions?
Exercise 8-1 ,[object Object],[object Object],[object Object]
Branching (Flow Control) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Notation - Single  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],start end x>4? get x Print “Hurray” T F
Notation - Dual ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],start end x>4? Get x Print “Hurray” Print “Sorry” T F
Notation – Multiple (Pseudocode) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Notation – Multiple (Flowchart) start end X=3 Print “very close” T F eval x X=2 Get x X=1 Print “close” Print “bang on” Print “not even close” T T F F
Case versus Nested IF ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise 8-2 ,[object Object],[object Object]
Conditional Code in Ruby ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Quest: Project Work ,[object Object],[object Object],[object Object],[object Object]
Project Work ,[object Object],[object Object],[object Object],[object Object]
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Questions? ,[object Object],[object Object]

Mais conteúdo relacionado

Mais procurados

Error handling and debugging
Error handling and debuggingError handling and debugging
Error handling and debugging
salissal
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
luhkahreth
 
Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2
Raja Hamid
 
Advantages Over Conventional Error Handling in OOP
Advantages Over Conventional Error Handling in OOPAdvantages Over Conventional Error Handling in OOP
Advantages Over Conventional Error Handling in OOP
Raju Dawadi
 

Mais procurados (20)

Error handling and debugging in vb
Error handling and debugging in vbError handling and debugging in vb
Error handling and debugging in vb
 
Function procedure c6 c7
Function procedure  c6 c7Function procedure  c6 c7
Function procedure c6 c7
 
Error handling and debugging
Error handling and debuggingError handling and debugging
Error handling and debugging
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Introduction to flowchart
Introduction to flowchartIntroduction to flowchart
Introduction to flowchart
 
Unit 3 Foc
Unit  3 FocUnit  3 Foc
Unit 3 Foc
 
Algorithm and psuedocode
Algorithm and psuedocodeAlgorithm and psuedocode
Algorithm and psuedocode
 
Programing Fundamental
Programing FundamentalPrograming Fundamental
Programing Fundamental
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchart
 
Debugging in .Net
Debugging in .NetDebugging in .Net
Debugging in .Net
 
Pseudocode By ZAK
Pseudocode By ZAKPseudocode By ZAK
Pseudocode By ZAK
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Problem solving and design
Problem solving and designProblem solving and design
Problem solving and design
 
CPP10 - Debugging
CPP10 - DebuggingCPP10 - Debugging
CPP10 - Debugging
 
Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
 
The pseudocode
The pseudocodeThe pseudocode
The pseudocode
 
Advantages Over Conventional Error Handling in OOP
Advantages Over Conventional Error Handling in OOPAdvantages Over Conventional Error Handling in OOP
Advantages Over Conventional Error Handling in OOP
 
CMIS 102 HANDS-ON LAB WEEK 6 OVERVIEW THIS HANDS-ON LAB ALLOWS YOU TO FOLLOW ...
CMIS 102 HANDS-ON LAB WEEK 6 OVERVIEW THIS HANDS-ON LAB ALLOWS YOU TO FOLLOW ...CMIS 102 HANDS-ON LAB WEEK 6 OVERVIEW THIS HANDS-ON LAB ALLOWS YOU TO FOLLOW ...
CMIS 102 HANDS-ON LAB WEEK 6 OVERVIEW THIS HANDS-ON LAB ALLOWS YOU TO FOLLOW ...
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 

Destaque

Right form of verbs
Right form of verbsRight form of verbs
Right form of verbs
Fakrul Razu
 
Class 8 english 1st paper filling in a form lesson-2 and going through immig...
Class 8 english 1st paper filling in a form  lesson-2 and going through immig...Class 8 english 1st paper filling in a form  lesson-2 and going through immig...
Class 8 english 1st paper filling in a form lesson-2 and going through immig...
Abdulláh Mámun
 
Saltamami 2016 by tanbircox
Saltamami 2016 by tanbircoxSaltamami 2016 by tanbircox
Magic method of fill in the blanks by tanbircox
Magic method of fill in the blanks by tanbircoxMagic method of fill in the blanks by tanbircox
Magic method of fill in the blanks by tanbircox
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Current affairs a to z for all competitive exams
Current affairs a to z for all competitive examsCurrent affairs a to z for all competitive exams
Current affairs a to z for all competitive exams
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 

Destaque (20)

Jsc latest math complete solution guide tanbircox
Jsc latest math complete solution guide tanbircoxJsc latest math complete solution guide tanbircox
Jsc latest math complete solution guide tanbircox
 
Sample questions and answers for class JSC students [Bangladesh]
Sample questions and answers for class JSC students [Bangladesh]Sample questions and answers for class JSC students [Bangladesh]
Sample questions and answers for class JSC students [Bangladesh]
 
Class 8 math lesson 2 (munafa)
Class 8 math lesson 2 (munafa)Class 8 math lesson 2 (munafa)
Class 8 math lesson 2 (munafa)
 
Right form of verbs
Right form of verbsRight form of verbs
Right form of verbs
 
Mathematics
MathematicsMathematics
Mathematics
 
Jsc
JscJsc
Jsc
 
Class 8 english 1st paper filling in a form lesson-2 and going through immig...
Class 8 english 1st paper filling in a form  lesson-2 and going through immig...Class 8 english 1st paper filling in a form  lesson-2 and going through immig...
Class 8 english 1st paper filling in a form lesson-2 and going through immig...
 
Saltamami 2016 by tanbircox
Saltamami 2016 by tanbircoxSaltamami 2016 by tanbircox
Saltamami 2016 by tanbircox
 
Magic method of fill in the blanks by tanbircox
Magic method of fill in the blanks by tanbircoxMagic method of fill in the blanks by tanbircox
Magic method of fill in the blanks by tanbircox
 
Health benefits and medicinal properties of bd fruits
Health benefits and medicinal properties of bd fruitsHealth benefits and medicinal properties of bd fruits
Health benefits and medicinal properties of bd fruits
 
Sahih bukhari shareef bangla unicode text
Sahih bukhari shareef bangla unicode textSahih bukhari shareef bangla unicode text
Sahih bukhari shareef bangla unicode text
 
Sample questions and answer for class 9 [Bangladesh]
Sample questions and answer for class 9 [Bangladesh]Sample questions and answer for class 9 [Bangladesh]
Sample questions and answer for class 9 [Bangladesh]
 
Rules for filling correct form of the verb
Rules for filling  correct form of the verbRules for filling  correct form of the verb
Rules for filling correct form of the verb
 
Current affairs a to z for all competitive exams
Current affairs a to z for all competitive examsCurrent affairs a to z for all competitive exams
Current affairs a to z for all competitive exams
 
Class 8 english announcements on board 2 lesson 6
Class 8 english announcements on board 2 lesson 6Class 8 english announcements on board 2 lesson 6
Class 8 english announcements on board 2 lesson 6
 
Class 8 english lesson 1 health
Class 8 english lesson  1 healthClass 8 english lesson  1 health
Class 8 english lesson 1 health
 
Class 8 english lesson 2 the history of the wheel
Class 8 english lesson 2 the history of the wheelClass 8 english lesson 2 the history of the wheel
Class 8 english lesson 2 the history of the wheel
 
Class 8 english lesson 2 the ama divers
Class 8 english lesson 2 the ama diversClass 8 english lesson 2 the ama divers
Class 8 english lesson 2 the ama divers
 
Class 8 english destination
Class 8 english destinationClass 8 english destination
Class 8 english destination
 
Class 8 english lesson 4 our ethnic friend-2
Class 8 english lesson 4 our ethnic friend-2Class 8 english lesson 4 our ethnic friend-2
Class 8 english lesson 4 our ethnic friend-2
 

Semelhante a Class 8 Lecture Notes

Copy of dti2143/dam31303 chap 1 problem solving and program design
Copy of dti2143/dam31303 chap 1 problem solving and program designCopy of dti2143/dam31303 chap 1 problem solving and program design
Copy of dti2143/dam31303 chap 1 problem solving and program design
alish sha
 
Fundamentals of Programming Lecture #1.pptx
Fundamentals of Programming Lecture #1.pptxFundamentals of Programming Lecture #1.pptx
Fundamentals of Programming Lecture #1.pptx
Eyasu46
 
Lec-ProblemSolving.pptx
Lec-ProblemSolving.pptxLec-ProblemSolving.pptx
Lec-ProblemSolving.pptx
miansaad18
 

Semelhante a Class 8 Lecture Notes (20)

AlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdfAlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdf
 
Basic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and FlowchartsBasic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and Flowcharts
 
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptLecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
 
Copy of dti2143/dam31303 chap 1 problem solving and program design
Copy of dti2143/dam31303 chap 1 problem solving and program designCopy of dti2143/dam31303 chap 1 problem solving and program design
Copy of dti2143/dam31303 chap 1 problem solving and program design
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Algorithms and Flowchart.ppt
Algorithms and Flowchart.pptAlgorithms and Flowchart.ppt
Algorithms and Flowchart.ppt
 
learn computer science.ppt
learn computer science.pptlearn computer science.ppt
learn computer science.ppt
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language Course
 
Fundamentals of Programming Lecture #1.pptx
Fundamentals of Programming Lecture #1.pptxFundamentals of Programming Lecture #1.pptx
Fundamentals of Programming Lecture #1.pptx
 
Introduction To Programming
Introduction To ProgrammingIntroduction To Programming
Introduction To Programming
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
our c prog work
our c prog workour c prog work
our c prog work
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
Learn C
Learn CLearn C
Learn C
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
 
01 Algorithms And Flowcharts.ppt
01 Algorithms And Flowcharts.ppt01 Algorithms And Flowcharts.ppt
01 Algorithms And Flowcharts.ppt
 
4. programing 101
4. programing 1014. programing 101
4. programing 101
 
2. Algorithms Representations (C++).pptx
2. Algorithms Representations (C++).pptx2. Algorithms Representations (C++).pptx
2. Algorithms Representations (C++).pptx
 
ALGORITHM PPT GUIDE.pdf
ALGORITHM PPT GUIDE.pdfALGORITHM PPT GUIDE.pdf
ALGORITHM PPT GUIDE.pdf
 
Lec-ProblemSolving.pptx
Lec-ProblemSolving.pptxLec-ProblemSolving.pptx
Lec-ProblemSolving.pptx
 

Mais de Stephen Parsons

Class 6 truth tables and boolean math
Class 6   truth tables and boolean mathClass 6   truth tables and boolean math
Class 6 truth tables and boolean math
Stephen Parsons
 

Mais de Stephen Parsons (18)

Atlantic Woodworkers Website Strategy
Atlantic Woodworkers Website StrategyAtlantic Woodworkers Website Strategy
Atlantic Woodworkers Website Strategy
 
Chairs Report to LSCRS 2012 AGM
Chairs Report to LSCRS 2012 AGMChairs Report to LSCRS 2012 AGM
Chairs Report to LSCRS 2012 AGM
 
Class 10 Arrays
Class 10 ArraysClass 10 Arrays
Class 10 Arrays
 
Program Renewal for NSCC Schools 2010-11
Program Renewal for NSCC Schools 2010-11Program Renewal for NSCC Schools 2010-11
Program Renewal for NSCC Schools 2010-11
 
Class 7 lecture notes
Class 7 lecture notesClass 7 lecture notes
Class 7 lecture notes
 
Class 6a ruby math
Class 6a   ruby mathClass 6a   ruby math
Class 6a ruby math
 
Class 6 truth tables and boolean math
Class 6   truth tables and boolean mathClass 6   truth tables and boolean math
Class 6 truth tables and boolean math
 
Class 5 - Set Theory and Venn Diagrams
Class 5 - Set Theory and Venn DiagramsClass 5 - Set Theory and Venn Diagrams
Class 5 - Set Theory and Venn Diagrams
 
Class 4 IPO and Intro to Ruby
Class 4 IPO and Intro to RubyClass 4 IPO and Intro to Ruby
Class 4 IPO and Intro to Ruby
 
Class 3 Binary & Hexadecimal
Class 3 Binary & HexadecimalClass 3 Binary & Hexadecimal
Class 3 Binary & Hexadecimal
 
Class 2 Math I
Class 2 Math IClass 2 Math I
Class 2 Math I
 
Class 1 introduction to logic & problem solving
Class 1   introduction to logic & problem solvingClass 1   introduction to logic & problem solving
Class 1 introduction to logic & problem solving
 
Portfolio Of A Community
Portfolio Of A CommunityPortfolio Of A Community
Portfolio Of A Community
 
Cause & effect analysis part 2
Cause & effect analysis part 2Cause & effect analysis part 2
Cause & effect analysis part 2
 
Cause & effect analysis part 1
Cause & effect analysis part 1Cause & effect analysis part 1
Cause & effect analysis part 1
 
Class 11 lecture notes
Class 11 lecture notesClass 11 lecture notes
Class 11 lecture notes
 
Class 10 Lecture Notes
Class 10  Lecture  NotesClass 10  Lecture  Notes
Class 10 Lecture Notes
 
Deck Project Phase II
Deck Project Phase IIDeck Project Phase II
Deck Project Phase II
 

Class 8 Lecture Notes

  • 1. Class 8 – Conditional Logic
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. Notation – Multiple (Flowchart) start end X=3 Print “very close” T F eval x X=2 Get x X=1 Print “close” Print “bang on” Print “not even close” T T F F
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.

Notas do Editor

  1. Programmatic Algorithms will be interested in efficiency and effectiveness – elegance