LAB-03 Logical Operations I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum.

Slides:



Advertisements
Similar presentations
Decision Structures - If / Else If / Else. Decisions Often we need to make decisions based on information that we receive. Often we need to make decisions.
Advertisements

WHERE Clause Chapter 2. Objectives Limit rows by using a WHERE clause Use the LIKE operator Effect of NULL values Use compound conditions Use the BETWEEN.
Propositional Predicate
Chapter 3 Program Design And Branching Structures.
LAB-04 IF Structure I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum & Minerals.
1 ICS 101 – LAB 2 Arithmetic Operations I Putu Danu Raharja kfupm.edu.sa Information & Computer Science Department CCSE - King Fahd University.
LAB-03 Logical Operations I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum.
1-1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
1 9/24/07CS150 Introduction to Computer Science 1 Relational Operators and the If Statement.
1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
1 Inference Rules and Proofs Z: Inference Rules and Proofs.
LAB-05 Function I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum & Minerals.
Expressions and statements Applications of Computer Programming in Earth Sciences Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences.
1 CS150 Introduction to Computer Science 1 Relational Operators and the If Statement 9/22/08.
ICS 101 – Introduction to Computer Programming I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University.
LAB-12 2-D Array I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum & Minerals.
LAB-10 1-D Array I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum & Minerals.
Binary Logic and Gates COE 202 Digital Logic Design Dr. Aiman El-Maleh
Chapter 4: Operators Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills /1436.
Conditionals (Cont’d). 2 Nested if/else question Formula for body mass index (BMI): Write a program that produces output like the following: This program.
Computer Science 101 The Boolean System. George Boole British mathematician ( ) Boolean algebra –Logic –Set theory –Circuits –Conditions in if.
XOR and XNOR Logic Gates. XOR Function Output Y is TRUE if input A OR input B are TRUE Exclusively, else it is FALSE. Logic Symbol  Description  Truth.
Data types and their representation Jordi Cortadella Department of Computer Science.
E - BOOK FOR COLLEGE ALGEBRA King Fahd University of Petroleum & Minerals 2.2 E - BOOK FOR COLLEGE ALGEBRA King Fahd University of Petroleum & Minerals.
Computer Science 210 Computer Organization Introduction to Boolean Algebra.
1 Week 2: Variables and Assignment Statements READING: 1.4 – 1.6 EECS Introduction to Computing for the Physical Sciences.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand how decisions are made in a computer ❏ To understand the logical.
Islamic University Of Gaza, Nael Aburas Data Storage Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas
Combination of logic gates  Logic gates can be combined to produce more complex functions.  They can also be combined to substitute one type of gate.
E - BOOK FOR COLLEGE ALGEBRA King Fahd University of Petroleum & Minerals B.1 E - BOOK FOR COLLEGE ALGEBRA King Fahd University of Petroleum & Minerals.
E - BOOK FOR COLLEGE ALGEBRA King Fahd University of Petroleum & Minerals A1 E - BOOK FOR COLLEGE ALGEBRA King Fahd University of Petroleum & Minerals.
Thinking Mathematically
IB Computer Science – Logic
Review if imag(x) > 0 fprintf('Sorry, but I don''t understand complex numbers.\n'); return end if x < 10 % leave this out, type the next line first, and.
E - BOOK FOR COLLEGE ALGEBRA King Fahd University of Petroleum & Minerals 3.3 E - BOOK FOR COLLEGE ALGEBRA King Fahd University of Petroleum & Minerals.
Boolean Values The true story ;=P. Expressions.
LAB-09 DO WHILE loop I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum & Minerals.
E - BOOK FOR COLLEGE ALGEBRA King Fahd University of Petroleum & Minerals 2.6 E - BOOK FOR COLLEGE ALGEBRA King Fahd University of Petroleum & Minerals.
ICS102 Lecture 8 : Boolean Expressions King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Random Functions Selection Structure Comparison Operators Logical Operator
Eng. Mai Z. Alyazji October, 2016
Computer Science 210 Computer Organization
Making Choices with if Statements
Biconditional - 2 CS-708.
Basic Logical Operations (Fascinating)
Factoring if/else code
ALU Design: Shifter Details
Type boolean boolean: A logical type whose values are true and false.
Computers & Programming Languages
Types, Truth, and Expressions (Part 2)
Relational Operators Operator Meaning < Less than > Greater than
Types, Truth, and Expressions (Part 2)
King Fahd University of Petroleum and Minerals
Types, Truth, and Expressions (Part 2)
ICS 253: Discrete Structures I
Computer Science 210 Computer Organization
GCSE Computer Science – Logic Gates & Boolean Expressions
Types, Truth, and Expressions (Part 2)
LAB-06 IF + Functions I Putu Danu Raharja
Expressions.
Binary Logic.
Truth tables Mrs. Palmer.
Selection—Making Decisions
Topics discussed in this section:
Basic Logic Operations
Eng. Ahmed M Bader El-Din October, 2018
5.03 Apply operators and Boolean expressions
Lecture 9: Implementing Complex Logic
Precedence tables and activity networks
ICS 101 Lab 3 Hossain Arif ICS Dept
Presentation transcript:

LAB-03 Logical Operations I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum & Minerals

ICS101-LAB03-Term073 2 Logical Operators By the order of precedence:.NOT..AND..OR.

ICS101-LAB03-Term073 3 Truth Table PQP.AND.QP.OR.Q.NOT.P.TRUE..FALSE..TRUE..FALSE..TRUE..FALSE..TRUE..FALSE..TRUE..FALSE..TRUE.

ICS101-LAB03-Term073 4 Relational Operators Returns logical value (.TRUE. Or.FALSE.).EQ..NE..GT..GE..LT..LE. Their precedence are lower than arithmetic operations.

ICS101-LAB03-Term073 5 Exercise-1 Write a program that reads inputs X and Y. Then, it evaluates the following expressions: X > 7 X < 10 4 <= X <= > X >= > X > 50 (X > 8) AND (Y >= 19)

ICS101-LAB03-Term073 6 Exercise-2 REAL X, Y LOGICAL TEST X= 1.0/3.0 Y= X*3.0 TEST = (Y.EQ. 1.0) PRINT *, "IT IS ", TEST, " THAT ", Y, " = ", 1.0 TEST = (X.EQ ) PRINT *, "IT IS ", TEST, " THAT ", X, " = ", END

ICS101-LAB03-Term073 7 Exercise-3 Write a program to test the following equivalences:.NOT.(A.GT. B.AND. B.LT. C) A.LE. B.OR. B.GE. C