SlideShare a Scribd company logo
Using Java
MINISTRY OF EDUCATION & HIGHER EDUCATION
COLLEGE OF SCIENCE AND TECHNOLOGY
KHANYOUNIS- PALESTINE
Lecture 6
Decision Making : Equality and Relational Operators
 What is the decision ?
 Equality and relational operators.
 Precedence and associatively of operations
 How to use if ?
 Practice
 Be care
 Emank X Mezank
2Presented & Prepared by: Mahmoud R. Alfarra
 For example, the condition "grade is greater
than or equal to 60" determines whether a
student passed a test.
3Presented & Prepared by: Mahmoud R. Alfarra
What is the decision ?
Note 5 applications demand the making decision
HW 5.1
 Conditions in if statements can be formed by
using the equality operators and relational
operators.
 Equality operators are used to check if two
operands are equals or not.
 Relational operators are used to check if one
of two operands are greater or less than
another.
4Presented & Prepared by: Mahmoud R. Alfarra
Equality and relational operators
5Presented & Prepared by: Mahmoud R. Alfarra
Equality and relational operators
6Presented & Prepared by: Mahmoud R. Alfarra
Precedence and associatively of operations
7Presented & Prepared by: Mahmoud R. Alfarra
How to use if ?
If (condition)
{
/*Tasks will be executed
* if the condition true*/
}
condition
yesNo
If true
Executed
at all
 Write a program to compare two numbers
and print the larger, smaller, equal or not.
8Presented & Prepared by: Mahmoud R. Alfarra
Example: Compare Integers
Write a program to calculate the summation,
multiple, division, subtraction and then compare
the results to print the larger, smaller, equal or notHW 5.2
9Presented & Prepared by: Mahmoud R. Alfarra
Example: Compare Integers
Rewrite
this
program
using
another
values
HW 5.3
10Presented & Prepared by: Mahmoud R. Alfarra
Forgetting the left and/or right parentheses for the condition
in an if statement is a syntax error the parentheses are
required.
Confusing the equality operator, ==, with the assignment
operator, =, can cause a logic error or a syntax error.
It is a syntax error if the operators ==, !=, >= and <= contain
spaces between their symbols, as in = =, ! =, > = and < =,
respectively.
Reversing the operators !=, >= and <=, as in =!, => and =<, is
a syntax error.
‫تعاىل‬ ‫هللا‬ ‫قال‬:
(‫املنفوش‬ ‫كالعهن‬‫اجلبال‬ ‫تكون‬ ‫يوم‬)
11Presented & Prepared by: Mahmoud R. Alfarra
If … else
&
The family 
12Presented & Prepared by: Mahmoud R. Alfarra

More Related Content

What's hot (20)

PDF
Operators, control statements represented in java
TharuniDiddekunta
 
PDF
CIS 1403 lab 4 selection
Hamad Odhabi
 
PPTX
Vb decision making statements
pragya ratan
 
PPT
Controlstatment in c
Md.Al-imran Roton
 
PPTX
Error handling and debugging in vb
Salim M
 
PDF
Chapter 3 branching v4
Sunarto Quek
 
PPTX
Intro To C++ - Class 12 - For, do … While
Blue Elephant Consulting
 
PPT
Class 9 Lecture Notes
Stephen Parsons
 
PPT
Exception handling in c++ by manoj vasava
Manoj_vasava
 
PPTX
Decision statements in vb.net
ilakkiya
 
DOCX
Exception handling
vishal choudhary
 
PDF
Control structures in Java
Ravi_Kant_Sahu
 
PPTX
Intro To C++ - Class 10 - Control Statements: Part 2
Blue Elephant Consulting
 
DOCX
Cis 355 i lab 1 of 6
helpido9
 
PPT
Control structures i
Ahmad Idrees
 
DOCX
Cis 355 i lab 2 of 6
helpido9
 
DOCX
Cis 355 ilab 2 of 6
comp274
 
PDF
The pseudocode
Asha Sari
 
DOCX
Cis 355 i lab 1 of 6
solutionjug4
 
PDF
Fundamentals of programming)
jakejakejake2
 
Operators, control statements represented in java
TharuniDiddekunta
 
CIS 1403 lab 4 selection
Hamad Odhabi
 
Vb decision making statements
pragya ratan
 
Controlstatment in c
Md.Al-imran Roton
 
Error handling and debugging in vb
Salim M
 
Chapter 3 branching v4
Sunarto Quek
 
Intro To C++ - Class 12 - For, do … While
Blue Elephant Consulting
 
Class 9 Lecture Notes
Stephen Parsons
 
Exception handling in c++ by manoj vasava
Manoj_vasava
 
Decision statements in vb.net
ilakkiya
 
Exception handling
vishal choudhary
 
Control structures in Java
Ravi_Kant_Sahu
 
Intro To C++ - Class 10 - Control Statements: Part 2
Blue Elephant Consulting
 
Cis 355 i lab 1 of 6
helpido9
 
Control structures i
Ahmad Idrees
 
Cis 355 i lab 2 of 6
helpido9
 
Cis 355 ilab 2 of 6
comp274
 
The pseudocode
Asha Sari
 
Cis 355 i lab 1 of 6
solutionjug4
 
Fundamentals of programming)
jakejakejake2
 

Similar to 6 programming-using-java decision-making20102011- (20)

PDF
C++ problem solving operators ( conditional operators,logical operators, swit...
mshakeel44514451
 
PPTX
Programming fundamentals through javascript
Codewizacademy
 
PPTX
C++ IF STATMENT AND ITS TYPE
UNIVERSITY OF ENGINEERING AND TECHNOLOGY TAXILA
 
PPT
Chaptfffffuuer05.PPT
sdvdsvsdvsvds
 
PDF
Programming for Problem Solving
Kathirvel Ayyaswamy
 
PPT
Java™ (OOP) - Chapter 3: "Selections"
Gouda Mando
 
PPTX
Pi j1.3 operators
mcollison
 
PPT
Cso gaddis java_chapter3
mlrbrown
 
PDF
Selection & Making Decisions in c
yndaravind
 
PPT
Ch3
aamirsahito
 
PPTX
Programming note C#
Ahmad Syahmi Irfan
 
PPT
Chapter 4 Making Decisions
GhulamHussain142878
 
PPTX
AP COmputer Science Review if and else condition
ssuser8f59d0
 
PDF
ICP - Lecture 7 and 8
Hassaan Rahman
 
PPT
chap04-conditional.ppt
HeshamMohamed855920
 
DOC
Week2 dq4
amaxwell2012
 
PPTX
18CSS101J PROGRAMMING FOR PROBLEM SOLVING
GOWSIKRAJAP
 
PPT
Chapter 3 Selection of Java Chapter 3 Selection of Java
AhsirYu
 
PDF
Decision control
Learn By Watch
 
PPT
Java Language How to Programme A high Level Language
sayedyousafhashimi10
 
C++ problem solving operators ( conditional operators,logical operators, swit...
mshakeel44514451
 
Programming fundamentals through javascript
Codewizacademy
 
Chaptfffffuuer05.PPT
sdvdsvsdvsvds
 
Programming for Problem Solving
Kathirvel Ayyaswamy
 
Java™ (OOP) - Chapter 3: "Selections"
Gouda Mando
 
Pi j1.3 operators
mcollison
 
Cso gaddis java_chapter3
mlrbrown
 
Selection & Making Decisions in c
yndaravind
 
Programming note C#
Ahmad Syahmi Irfan
 
Chapter 4 Making Decisions
GhulamHussain142878
 
AP COmputer Science Review if and else condition
ssuser8f59d0
 
ICP - Lecture 7 and 8
Hassaan Rahman
 
chap04-conditional.ppt
HeshamMohamed855920
 
Week2 dq4
amaxwell2012
 
18CSS101J PROGRAMMING FOR PROBLEM SOLVING
GOWSIKRAJAP
 
Chapter 3 Selection of Java Chapter 3 Selection of Java
AhsirYu
 
Decision control
Learn By Watch
 
Java Language How to Programme A high Level Language
sayedyousafhashimi10
 
Ad

More from Mahmoud Alfarra (20)

PPT
Chapter 10: hashing data structure
Mahmoud Alfarra
 
PPT
Chapter9 graph data structure
Mahmoud Alfarra
 
PPT
Chapter 8: tree data structure
Mahmoud Alfarra
 
PPT
Chapter 7: Queue data structure
Mahmoud Alfarra
 
PPT
Chapter 6: stack data structure
Mahmoud Alfarra
 
PPT
Chapter 5: linked list data structure
Mahmoud Alfarra
 
PPT
Chapter 4: basic search algorithms data structure
Mahmoud Alfarra
 
PPT
Chapter 3: basic sorting algorithms data structure
Mahmoud Alfarra
 
PPT
Chapter 2: array and array list data structure
Mahmoud Alfarra
 
PPT
Chapter1 intro toprincipleofc#_datastructure_b_cs
Mahmoud Alfarra
 
PPT
Chapter 0: introduction to data structure
Mahmoud Alfarra
 
PPTX
3 classification
Mahmoud Alfarra
 
PPT
5 programming-using-java intro-tooop20102011
Mahmoud Alfarra
 
PPT
3 programming-using-java introduction-to computer
Mahmoud Alfarra
 
PPT
1 programming-using-java -introduction
Mahmoud Alfarra
 
PPTX
تلخيص النصوص تلقائيا
Mahmoud Alfarra
 
PDF
4×4×4 لتحصيل التميز
Mahmoud Alfarra
 
PPTX
Data preparation and processing chapter 2
Mahmoud Alfarra
 
PPTX
Introduction to-data-mining chapter 1
Mahmoud Alfarra
 
PPT
Graph-Based Technique for Extracting Keyphrases In a Single-Document (GTEK)
Mahmoud Alfarra
 
Chapter 10: hashing data structure
Mahmoud Alfarra
 
Chapter9 graph data structure
Mahmoud Alfarra
 
Chapter 8: tree data structure
Mahmoud Alfarra
 
Chapter 7: Queue data structure
Mahmoud Alfarra
 
Chapter 6: stack data structure
Mahmoud Alfarra
 
Chapter 5: linked list data structure
Mahmoud Alfarra
 
Chapter 4: basic search algorithms data structure
Mahmoud Alfarra
 
Chapter 3: basic sorting algorithms data structure
Mahmoud Alfarra
 
Chapter 2: array and array list data structure
Mahmoud Alfarra
 
Chapter1 intro toprincipleofc#_datastructure_b_cs
Mahmoud Alfarra
 
Chapter 0: introduction to data structure
Mahmoud Alfarra
 
3 classification
Mahmoud Alfarra
 
5 programming-using-java intro-tooop20102011
Mahmoud Alfarra
 
3 programming-using-java introduction-to computer
Mahmoud Alfarra
 
1 programming-using-java -introduction
Mahmoud Alfarra
 
تلخيص النصوص تلقائيا
Mahmoud Alfarra
 
4×4×4 لتحصيل التميز
Mahmoud Alfarra
 
Data preparation and processing chapter 2
Mahmoud Alfarra
 
Introduction to-data-mining chapter 1
Mahmoud Alfarra
 
Graph-Based Technique for Extracting Keyphrases In a Single-Document (GTEK)
Mahmoud Alfarra
 
Ad

Recently uploaded (20)

PDF
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
PPTX
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPTX
infertility, types,causes, impact, and management
Ritu480198
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PPTX
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPTX
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
PDF
Introduction presentation of the patentbutler tool
MIPLM
 
PDF
Council of Chalcedon Re-Examined
Smiling Lungs
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
PDF
epi editorial commitee meeting presentation
MIPLM
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
infertility, types,causes, impact, and management
Ritu480198
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
Controller Request and Response in Odoo18
Celine George
 
Introduction presentation of the patentbutler tool
MIPLM
 
Council of Chalcedon Re-Examined
Smiling Lungs
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
Introduction to Indian Writing in English
Trushali Dodiya
 
epi editorial commitee meeting presentation
MIPLM
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 

6 programming-using-java decision-making20102011-

  • 1. Using Java MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE Lecture 6 Decision Making : Equality and Relational Operators
  • 2.  What is the decision ?  Equality and relational operators.  Precedence and associatively of operations  How to use if ?  Practice  Be care  Emank X Mezank 2Presented & Prepared by: Mahmoud R. Alfarra
  • 3.  For example, the condition "grade is greater than or equal to 60" determines whether a student passed a test. 3Presented & Prepared by: Mahmoud R. Alfarra What is the decision ? Note 5 applications demand the making decision HW 5.1
  • 4.  Conditions in if statements can be formed by using the equality operators and relational operators.  Equality operators are used to check if two operands are equals or not.  Relational operators are used to check if one of two operands are greater or less than another. 4Presented & Prepared by: Mahmoud R. Alfarra Equality and relational operators
  • 5. 5Presented & Prepared by: Mahmoud R. Alfarra Equality and relational operators
  • 6. 6Presented & Prepared by: Mahmoud R. Alfarra Precedence and associatively of operations
  • 7. 7Presented & Prepared by: Mahmoud R. Alfarra How to use if ? If (condition) { /*Tasks will be executed * if the condition true*/ } condition yesNo If true Executed at all
  • 8.  Write a program to compare two numbers and print the larger, smaller, equal or not. 8Presented & Prepared by: Mahmoud R. Alfarra Example: Compare Integers Write a program to calculate the summation, multiple, division, subtraction and then compare the results to print the larger, smaller, equal or notHW 5.2
  • 9. 9Presented & Prepared by: Mahmoud R. Alfarra Example: Compare Integers Rewrite this program using another values HW 5.3
  • 10. 10Presented & Prepared by: Mahmoud R. Alfarra Forgetting the left and/or right parentheses for the condition in an if statement is a syntax error the parentheses are required. Confusing the equality operator, ==, with the assignment operator, =, can cause a logic error or a syntax error. It is a syntax error if the operators ==, !=, >= and <= contain spaces between their symbols, as in = =, ! =, > = and < =, respectively. Reversing the operators !=, >= and <=, as in =!, => and =<, is a syntax error.
  • 11. ‫تعاىل‬ ‫هللا‬ ‫قال‬: (‫املنفوش‬ ‫كالعهن‬‫اجلبال‬ ‫تكون‬ ‫يوم‬) 11Presented & Prepared by: Mahmoud R. Alfarra
  • 12. If … else & The family  12Presented & Prepared by: Mahmoud R. Alfarra