SlideShare una empresa de Scribd logo
1 de 69
CHAPTER 4 FLOW CONTROL STRUCTURES JESS DALE DELA CRUZ
Method of Problem Solving   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The 5 steps in using a computer as a problem-solving tool  ,[object Object],[object Object],[object Object],[object Object],[object Object]
ALGORITHM ,[object Object]
FLOW CHART ,[object Object]
HISTORY OF FLOW CHART ,[object Object]
EXAMPLES
FLOW CHART ,[object Object]
Basic Symbols
BASIC SYMBOLS
MORE EXAMPLES
MORE EXAMPLES
MORE EXAMPLES
MORE EXAMPLES
 
 
Initializing Objects with Constructors   ,[object Object],[object Object]
CONTROL STATEMENTS ,[object Object]
LOOPING STATEMENTS ,[object Object],[object Object]
if Single-Selection Statement  ,[object Object],[object Object],[object Object],[object Object]
If …if else ,[object Object]
 
if...else Double-Selection Statement  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
if...else Double-Selection Statement Walang EndIf SA JAVA OK!!!!!
Conditional Operator (?:)  ,[object Object],[object Object],[object Object]
 
Nested if...else Statements  ,[object Object]
If studentGrade is greater than or equal to 90, the first four conditions  will be true, but only the statement in the if-part of the first if...else statement  will execute. After that statement executes,  the else-part of the "outermost" if...else statement is skipped.  Most Java programmers prefer to write the preceding if...else statement as
Dangling-else Problem  ,[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]
BLOCKS ,[object Object]
 
 
 
Switch statement ,[object Object]
 
EXAMPLES
Use && for “and” ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Use || for “ or” ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
LOGICAL OPERATOR ,[object Object],[object Object],[object Object]
 
For loop ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
LET’S ANALYZE THE C++ PROGRAM WITH RESPECT TO FOR LOOP
COUNTING STATEMENT ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],count++ or ++count count = count + 1 n++  or ++n n = n+1 i++ or ++i i = i + 1 ALTERNATIVE EXPRESSION
COUNTING STATEMENT count-- or --count count = count - 1 n--  or --n n = n-1 i-- or --i i = i - 1 ALTERNATIVE EXPRESSION
 
 
Good morning. It's 30 minutes past 8 o'clock on April 13, 1997.
 
 
 
 
Actually kahit wala yan tatakbo ang program  Not good process hangga’t maari iwasan
break statement ,[object Object],[object Object]
Continue statement ,[object Object],[object Object]
DIFFRENCE  BETWEEN BREAK AND CONTINUE ,[object Object],[object Object]
NOTE ,[object Object]
 
 
 
 
 
 
 
 
 
 
 
 
 

Más contenido relacionado

La actualidad más candente

Operators, control statements represented in java
Operators, control statements  represented in javaOperators, control statements  represented in java
Operators, control statements represented in javaTharuniDiddekunta
 
Cprogrammingprogramcontrols
CprogrammingprogramcontrolsCprogrammingprogramcontrols
Cprogrammingprogramcontrolsteach4uin
 
Control structures in Java
Control structures in JavaControl structures in Java
Control structures in JavaRavi_Kant_Sahu
 
javase-1.4.2-docs-guide-lang-assert
javase-1.4.2-docs-guide-lang-assertjavase-1.4.2-docs-guide-lang-assert
javase-1.4.2-docs-guide-lang-assertlukebonham
 
The Three Basic Selection Structures in C++ Programming Concepts
The Three Basic Selection Structures in C++ Programming ConceptsThe Three Basic Selection Structures in C++ Programming Concepts
The Three Basic Selection Structures in C++ Programming ConceptsTech
 
Control Structures in Visual Basic
Control Structures in  Visual BasicControl Structures in  Visual Basic
Control Structures in Visual BasicTushar Jain
 
04 control structures 1
04 control structures 104 control structures 1
04 control structures 1Jomel Penalba
 
Control structures in java
Control structures in javaControl structures in java
Control structures in javaVINOTH R
 
Control structures in C++ Programming Language
Control structures in C++ Programming LanguageControl structures in C++ Programming Language
Control structures in C++ Programming LanguageAhmad Idrees
 
Chapter 2 : Programming with Java Statements
Chapter 2 : Programming with Java StatementsChapter 2 : Programming with Java Statements
Chapter 2 : Programming with Java StatementsIt Academy
 
Control structure C++
Control structure C++Control structure C++
Control structure C++Anil Kumar
 
Conditional statement
Conditional statementConditional statement
Conditional statementMaxie Santos
 
Selection statements
Selection statementsSelection statements
Selection statementsHarsh Dabas
 
Decision making and loop in C#
Decision making and loop in C#Decision making and loop in C#
Decision making and loop in C#Prasanna Kumar SM
 

La actualidad más candente (19)

Operators, control statements represented in java
Operators, control statements  represented in javaOperators, control statements  represented in java
Operators, control statements represented in java
 
Cprogrammingprogramcontrols
CprogrammingprogramcontrolsCprogrammingprogramcontrols
Cprogrammingprogramcontrols
 
Control structures in Java
Control structures in JavaControl structures in Java
Control structures in Java
 
javase-1.4.2-docs-guide-lang-assert
javase-1.4.2-docs-guide-lang-assertjavase-1.4.2-docs-guide-lang-assert
javase-1.4.2-docs-guide-lang-assert
 
The Three Basic Selection Structures in C++ Programming Concepts
The Three Basic Selection Structures in C++ Programming ConceptsThe Three Basic Selection Structures in C++ Programming Concepts
The Three Basic Selection Structures in C++ Programming Concepts
 
Control Structures in Visual Basic
Control Structures in  Visual BasicControl Structures in  Visual Basic
Control Structures in Visual Basic
 
04 control structures 1
04 control structures 104 control structures 1
04 control structures 1
 
Control structures in java
Control structures in javaControl structures in java
Control structures in java
 
Control structures in C++ Programming Language
Control structures in C++ Programming LanguageControl structures in C++ Programming Language
Control structures in C++ Programming Language
 
Chapter 2 : Programming with Java Statements
Chapter 2 : Programming with Java StatementsChapter 2 : Programming with Java Statements
Chapter 2 : Programming with Java Statements
 
Control Structures: Part 1
Control Structures: Part 1Control Structures: Part 1
Control Structures: Part 1
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Control structure C++
Control structure C++Control structure C++
Control structure C++
 
Java unit3
Java unit3Java unit3
Java unit3
 
Conditional statement
Conditional statementConditional statement
Conditional statement
 
Control statement-Selective
Control statement-SelectiveControl statement-Selective
Control statement-Selective
 
Selection statements
Selection statementsSelection statements
Selection statements
 
Decision making and loop in C#
Decision making and loop in C#Decision making and loop in C#
Decision making and loop in C#
 
Loop
LoopLoop
Loop
 

Destacado

Ch01 basic-java-programs
Ch01 basic-java-programsCh01 basic-java-programs
Ch01 basic-java-programsJames Brotsos
 
Auto insurance final presentation
Auto insurance final presentationAuto insurance final presentation
Auto insurance final presentationPiyush Khatter
 
Various general insurance companies and its policies
Various general insurance companies and its policies  Various general insurance companies and its policies
Various general insurance companies and its policies Apurv Gourav
 
A Project Report on Insurance System with Tracking Manager
 A Project Report on Insurance System with Tracking Manager  A Project Report on Insurance System with Tracking Manager
A Project Report on Insurance System with Tracking Manager Sachin Kariyattin
 
Do you need commercial auto insurance By Floyd Arthur (PPT)
Do you need commercial auto insurance By Floyd Arthur (PPT)Do you need commercial auto insurance By Floyd Arthur (PPT)
Do you need commercial auto insurance By Floyd Arthur (PPT)Floyd Arthur
 
Testing web services
Testing web servicesTesting web services
Testing web servicesTaras Lytvyn
 
java Project report online banking system
java Project report online banking systemjava Project report online banking system
java Project report online banking systemVishNu KuNtal
 
Core Java Slides
Core Java SlidesCore Java Slides
Core Java SlidesVinit Vyas
 

Destacado (10)

Ch01 basic-java-programs
Ch01 basic-java-programsCh01 basic-java-programs
Ch01 basic-java-programs
 
Auto insurance final presentation
Auto insurance final presentationAuto insurance final presentation
Auto insurance final presentation
 
Various general insurance companies and its policies
Various general insurance companies and its policies  Various general insurance companies and its policies
Various general insurance companies and its policies
 
Presentation on java
Presentation  on  javaPresentation  on  java
Presentation on java
 
Java programming-examples
Java programming-examplesJava programming-examples
Java programming-examples
 
A Project Report on Insurance System with Tracking Manager
 A Project Report on Insurance System with Tracking Manager  A Project Report on Insurance System with Tracking Manager
A Project Report on Insurance System with Tracking Manager
 
Do you need commercial auto insurance By Floyd Arthur (PPT)
Do you need commercial auto insurance By Floyd Arthur (PPT)Do you need commercial auto insurance By Floyd Arthur (PPT)
Do you need commercial auto insurance By Floyd Arthur (PPT)
 
Testing web services
Testing web servicesTesting web services
Testing web services
 
java Project report online banking system
java Project report online banking systemjava Project report online banking system
java Project report online banking system
 
Core Java Slides
Core Java SlidesCore Java Slides
Core Java Slides
 

Similar a Chapter 4 flow control structures and arrays

Similar a Chapter 4 flow control structures and arrays (20)

Ap Power Point Chpt3
Ap Power Point Chpt3Ap Power Point Chpt3
Ap Power Point Chpt3
 
Cordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to JavascriptCordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to Javascript
 
Control Statement programming
Control Statement programmingControl Statement programming
Control Statement programming
 
Ap Power Point Chpt3 B
Ap Power Point Chpt3 BAp Power Point Chpt3 B
Ap Power Point Chpt3 B
 
java notes.pdf
java notes.pdfjava notes.pdf
java notes.pdf
 
jhtp9_ch04.ppt
jhtp9_ch04.pptjhtp9_ch04.ppt
jhtp9_ch04.ppt
 
Programming in Arduino (Part 2)
Programming in Arduino  (Part 2)Programming in Arduino  (Part 2)
Programming in Arduino (Part 2)
 
M C6java5
M C6java5M C6java5
M C6java5
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Java input Scanner
Java input Scanner Java input Scanner
Java input Scanner
 
conditional_statement.pdf
conditional_statement.pdfconditional_statement.pdf
conditional_statement.pdf
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
 
Control statements in java
Control statements in javaControl statements in java
Control statements in java
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
control statements
control statementscontrol statements
control statements
 
Ch3- Java Script.pdf
Ch3- Java Script.pdfCh3- Java Script.pdf
Ch3- Java Script.pdf
 
slides03.ppt
slides03.pptslides03.ppt
slides03.ppt
 
Final requirement
Final requirementFinal requirement
Final requirement
 
Loops and conditional statements
Loops and conditional statementsLoops and conditional statements
Loops and conditional statements
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 

Más de sshhzap

Intuit commissions manager
Intuit commissions managerIntuit commissions manager
Intuit commissions managersshhzap
 
Chapter 2.2 data structures
Chapter 2.2 data structuresChapter 2.2 data structures
Chapter 2.2 data structuressshhzap
 
Chapter 1 introduction to java technology
Chapter 1 introduction to java technologyChapter 1 introduction to java technology
Chapter 1 introduction to java technologysshhzap
 
Chapter3 basic java data types and declarations
Chapter3 basic java data types and declarationsChapter3 basic java data types and declarations
Chapter3 basic java data types and declarationssshhzap
 
Chapter2 java oop
Chapter2 java oopChapter2 java oop
Chapter2 java oopsshhzap
 
Exercises for ja se
Exercises for ja seExercises for ja se
Exercises for ja sesshhzap
 
Chapter 5 declaring classes & oop
Chapter 5 declaring classes  & oopChapter 5 declaring classes  & oop
Chapter 5 declaring classes & oopsshhzap
 

Más de sshhzap (7)

Intuit commissions manager
Intuit commissions managerIntuit commissions manager
Intuit commissions manager
 
Chapter 2.2 data structures
Chapter 2.2 data structuresChapter 2.2 data structures
Chapter 2.2 data structures
 
Chapter 1 introduction to java technology
Chapter 1 introduction to java technologyChapter 1 introduction to java technology
Chapter 1 introduction to java technology
 
Chapter3 basic java data types and declarations
Chapter3 basic java data types and declarationsChapter3 basic java data types and declarations
Chapter3 basic java data types and declarations
 
Chapter2 java oop
Chapter2 java oopChapter2 java oop
Chapter2 java oop
 
Exercises for ja se
Exercises for ja seExercises for ja se
Exercises for ja se
 
Chapter 5 declaring classes & oop
Chapter 5 declaring classes  & oopChapter 5 declaring classes  & oop
Chapter 5 declaring classes & oop
 

Último

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 

Último (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

Chapter 4 flow control structures and arrays