0% found this document useful (0 votes)
15 views7 pages

Module 1 Q2W1 4

This document is a lesson plan for Grade 10 Computer Programming focusing on operators and identifiers. It outlines the objectives, vocabulary, and types of operators including arithmetic, relational, and logical operators, along with examples and exercises for students. The lesson aims to help learners understand and apply these concepts in basic programming tasks.

Uploaded by

ianrelloso17
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)
15 views7 pages

Module 1 Q2W1 4

This document is a lesson plan for Grade 10 Computer Programming focusing on operators and identifiers. It outlines the objectives, vocabulary, and types of operators including arithmetic, relational, and logical operators, along with examples and exercises for students. The lesson aims to help learners understand and apply these concepts in basic programming tasks.

Uploaded by

ianrelloso17
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/ 7

GRADE-10

SCIENCE, TECHNOLOGY and ENGINEERING CP

Computer Programming
Module 2: Quarter 1(Week 3-4)

(OPERATORS AND IDENTIFIERS)


GRADE-10
SCIENCE, TECHNOLOGY and ENGINEERING CP
INTRODUCTION
This lesson will discuss the following topics, such as: Operators, Types of
Operators and Identifiers.

OBJECTIVES
At the end of this lesson, the learners should be able to:
Demonstrate the use of the different types of operators in basic
programming.
1. Understand the meaning of operator
2. Perform mathematical, relational and logical operations
3. Differentiate the Types of Identifiers

VOCABULARY

Identifier - This is a user-defined names in BASIC programming.


- Consisting of both letters amd numbers and often
Alphanumeric
other symbols.
- Beginners' All-purpose Symbolic Instruction Code is a
family of general-purpose, high-level programming
BASIC
languages whose design philosophy emphasizes ease
of use
- is a name or identifier that represents number or a
Variable string of characters whose value can change during or
after the execution of a BASIC program.
- is an identifier, a number, a string of characters whose
Constant value cannot change during or after the execution of
a BASIC program.
-
GRADE-10
SCIENCE, TECHNOLOGY and ENGINEERING CP
PRE-TEST
Direction : TRUE or FALSE: Write T if the statement is correct and F if the statement
is incorrect.

1. The value of a variable will always change during the running of a


program.
2. The variable n1=5 is a string type variable.
3. The symbol != is the “not equal to” operator.
4. The Logical Not inverse the result of its evaluation.
5. The % sign gives an integral result of the division.

Note: Refer to the Answer Key to know your score.

What’s New?
- Read Lesson Information closely and find out how much you can remember.
Then do Self-Check 1.1. Activity and Task Sheet 1.1 to know how much you
have learned.

Watch this!
GRADE-10
SCIENCE, TECHNOLOGY and ENGINEERING CP
Lesson Information 1.1
An Operator in a programming language is a symbol that tells the compiler or
interpreter to perform specific mathematical, relational or logical operation and
produce final result.

Arithmetic Operations
Arithmetic operators are used to carry out arithmetic operations in BASIC. These are
the symbols used to perform any mathematical operations between 2 or more
operands. These operators are executed according to their hierarchy or what is called
precedence rule. Table 16.1 below shows these operators according to their
hierarchy.
Table 6.1: Hierarchy of Arithmetic Operators
Operation Operators used Examples
Parentheses () (a+b)*c

Exponentiation ^ M = a + (b^4)

Multiplication * a*b=b*a
Division (Real) / 7/3=2.5
Modulo (Remainder) % 7%3=1
Addition + a + b=b + a
Subtraction - 9 – 6 =3

RELATIONAL OPERATORS
Consider a situation where we create two variables and assign them some values as
follows −
A = 20
B = 10
Here, it is obvious that variable A is greater than B in values. So, we need the help of
some symbols to write such expressions which are called relational expressions. If we
use C programming language, then it will be written as follows −
(A > B)
Here, we used a symbol > and it is called a relational operator and in their simplest
form, they produce Boolean results which means the result will be either true or false.
Similarly, a programming language provides various relational operators. The
following table lists down a few of the important relational operators available in C
programming language. Assume variable A holds 10 and variable B holds 20, then −

Operator Description Example

== Checks if the values of two operands are equal (A == B) is not true.


or not, if yes then condition becomes true.
GRADE-10
SCIENCE, TECHNOLOGY and ENGINEERING CP
!= Checks if the values of two operands are equal (A != B) is true.
or not, if values are not equal then condition
becomes true.

> Checks if the value of left operand is greater (A > B) is not true.
than the value of right operand, if yes then
condition becomes true.

< Checks if the value of left operand is less than (A < B) is true.
the value of right operand, if yes then condition
becomes true.

>= Checks if the value of left operand is greater (A >= B) is not true.
than or equal to the value of right operand, if yes
then condition becomes true.

<= Checks if the value of left operand is less than or (A <= B) is true.
equal to the value of right operand, if yes then
condition becomes true.

The if statement is used to check a condition and if the condition is true, then the body
of if statement is executed, otherwise the body of if statement is skipped.

Logical Operators
Logical operators are very important in any programming language and they help
us take decisions based on certain conditions. Suppose we want to combine the
result of two conditions, then logical AND and OR logical operators help us in
producing the final result.
The following table shows all the logical operators supported by the C language.
Assume variable A holds 1 and variable B holds 0, then −

Operator Description Example

&& Called Logical AND operator. If both the (A && B) is


operands are non-zero, then condition false.
becomes true.

|| Called Logical OR Operator. If any of the two (A || B) is true.


operands is non-zero, then condition becomes
true.
GRADE-10
SCIENCE, TECHNOLOGY and ENGINEERING CP
! Called Logical NOT Operator. Use to reverses !(A && B) is
the logical state of its operand. If a condition is true.
true then Logical NOT operator will make false.

Note: The 1 stands for TRUE and the 0 is FALSE.

Self-Check 1.1

A. IDENTIFICATION: Write your answer on the space provided before each number.
_____________1. What type of operator is used to evaluate 2 or more values or
variables and the result is True or False?
_____________2. What symbol represent the “Logical AND” operator?
_____________3. On what programming statement do the Relational Operators is
being used?
_____________4. What do you call to this symbol ==?
_____________5. This is a symbol that performs mathematical, relational and even
logical operations and produced final result.

Task Sheet 1.1

TITLE:
WRITTEN TEST

PERFORMANCE OBJECTIVE: Given the Task Sheet 1.1; Look for the attached Learning
Activity Sheet 1.

Source : Learning Activity Sheet 1

What’s more to do?

Learning Activity Sheet 1: INDIVIDUAL OUTPUT

ANSWER KEY

PRE-TEST SELF-CHECK 1.1


1. T 1. Relational Operator
2. F 2. &&
3. T 3. IF Statement
4. T 4. Equal to
5. F 5. Operator
GRADE-10
SCIENCE, TECHNOLOGY and ENGINEERING CP
SOURCES :
- COMPUTERS: Electronic Tools for an Information Age
Complete, 8th Edition
- https://www.tutorialspoint.com/computer_programming/computer_programming_operato
rs.htm#:~:text=An%20operator%20in%20a%20programming,operation%20and%20produce
%20final%20result.

You might also like