0% found this document useful (0 votes)
14 views46 pages

g10 - Programming Op - Maximus

The document provides an overview of programming operators in VB.NET, including arithmetic, comparison, logical, and assignment operators. It explains how to use and compute various logical operators with truth tables and includes activities for practice. The content is aimed at familiarizing learners with the different types of operators and their applications in programming.

Uploaded by

raina.almojuela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views46 pages

g10 - Programming Op - Maximus

The document provides an overview of programming operators in VB.NET, including arithmetic, comparison, logical, and assignment operators. It explains how to use and compute various logical operators with truth tables and includes activities for practice. The content is aimed at familiarizing learners with the different types of operators and their applications in programming.

Uploaded by

raina.almojuela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

PROGRAMMING

OPERATORS
LEARNING OUTCOMES
familiarize with all the programming
operators that are used in VB.NET
Identify what are the different types of
programming operators and how to use
them
compute a particular programming operator
LEARNING OUTCOMES
identify how to use and compute using each
logical operator in the truth table
analyze how to use truth table
demonstrate how to compute each logical
operator in the truth table
What are the Programming
Operators in VB.NET?
Programming operators in VB.NET are symbols or
keywords that define specific operations
performed on operands (values or variables). These
operators allow you to carry out a variety of
tasks, such as mathematical calculations, logical
comparisons, data manipulation, and more.
PROGRAMMING
OPERATORS
Arithmetic Operators
Comparison Operators
Logical Operators
Assignment Operators
Arithmetic Operator
These are used to perform mathematical operations.
Comparison Operator
These operators are commonly used in conditional
statements and loops to make decisions based on the
comparison results. Comparison operators are used to
compare two variable's values and return either True or
False
Comparison Operator

LESS THAN LESS THAN OR EQUAL TO

GREATER THAN GREATER THAN OR EQUAL TO

IS EQUAL NOT EQUAL TO


Less Than
Checks if the left operand is less than the right
operand.

Operator Symbol

<
Less Than or Equal
Checks if the left operand is less than or equal to the
right operand.

Operator Symbol

<=
Greater Than
Checks if the left operand is greater than the right
operand.

Operator Symbol

>
Greater Than or Equal
Checks if the left operand is greater than or equal to
the right operand.

Operator Symbol

>=
Equal to
Checks if two values are equal.

Operator Symbol

=
Not Equal
Checks if two values are not equal.

Operator Symbol

<> OR !=
REMINDER:

Before defining the syntax of a specific operator, you


must first declare the identifier or variable name that will
store the result. Assign it to the Boolean data type with
an initial value of null.
Logical Operators
Logical operators in VB.NET perform logical operations
on Boolean expressions, variables, or values. These
operators evaluate expressions and return a Boolean
result (True or False). Logical operators are primarily
used in decision-making and conditional statements
such as If...Then, While, or Do loops.
Logical Operators

LOGICAL NOT

LOGICAL OR

LOGICAL XOR

LOGICAL AND
Logical NOT
negates the value of the given
operands/variables value
Var_Name

Not
Truth Table - Logical NOT
LO OPERAND 1 RESULT

! true ?

! false ?
Truth Table - Logical NOT
LO OPERAND 1 RESULT

! true FALSE

! false TRUE
Logical OR
returns True if at least one of the
given operand or variable has a
value of True
Var_Name

Or
Truth Table - Logical OR
OPERAND 1 LO OPERAND 2 RESULT

false || true ?

false || false ?
Truth Table - Logical OR
OPERAND 1 LO OPERAND 2 RESULT

false || true TRUE

false || false FALSE


Logical XOR
return True if the two operands have
different values.

Var_Name

Xor
Truth Table - Logical XOR
OPERAND 1 LO OPERAND 2 RESULT

false ^ true ?

false ^ false ?
Truth Table - Logical XOR
OPERAND 1 LO OPERAND 2 RESULT

false ^ true TRUE

false ^ false FALSE


Logical AND
return True only when the given
operand/variables value are both True ,
otherwise it will return False

Var_Name

And
Truth Table - Logical AND
OPERAND 1 LO OPERAND 2 RESULT

false && true ?

false && false ?


Truth Table - Logical AND
OPERAND 1 LO OPERAND 2 RESULT

false && true FALSE

false && false FALSE


ACTIVITY - EASY LEVEL
Instruction: Based on the provided table,
compute the values of the variables or
operands using the given logical operator.

NOTE: Write the problem on your yellow


pad paper before solving it.
Logical NOT
Operand1 Result

T
Logical NOT
Operand1 Result

F T

T F

F T

T F
Logical OR
Operand1 Operand2 Result

F T

T F

F F

T T
Logical OR
Operand1 Operand2 Result

F T T

T F T

F F F

T T T
Logical AND
Operand1 Operand2 Result

F T

T F

F F

T T
Logical AND
Operand1 Operand2 Result

F T F

T F F

F F F

T T T
Logical XOR
Operand1 Operand2 Result

F T

T F

F F

T T
Logical XOR
Operand1 Operand2 Result

F T T

T F T

F F F

T T F
ASSIGNMENT 1 - ADVANCE LEVEL
Instruction: Based on the provided table,
compute the values of the variables or
operands using the given logical operator.

NOTE: Write the problem on your yellow


pad paper before solving it.
ADVANCE LEVEL - EXERCISE
p q r !p r || p q && r

T T F

T F F

F T F

F T F

T F F
ACTIVITY 2 - ADVANCE LEVEL
Instruction: Based on the provided table,
compute the values of the variables or
operands using the given logical operator.

NOTE: Write the problem on your yellow pad first


before solving it. NO SOLUTION NO CORRECT ANSWER
ACTIVITY 2 - ADVANCE LEVEL
p q r !q p || !p !p && r (!q ^ !p) ^ (p&&r)

F T T

F T F

F T T

F T F

F T T
ACTIVITY 2 - ADVANCE LEVEL
p q r (!r&&p) || (p ^ !q) (r || p) && (p &&r)

T T F

T F F

F T F

F T F

T F F
Thank You
Prepared by:

Mr. June Van Joveth A. Dionela


ICT Teacher

You might also like