Report of Group 4 of III-GOLD in TSHS for the second quarter of TLE.
- 1.
- 3. Avoid using confusing letters or numbers such as zero and
the letter O
- Examples: One_0, Ph0ne_Num
- 4. Use underscore (_) in replacement of a space
- Examples: Class_Num, Birth_date
- 5. Lessen the number of character of your variable. The shorter
the better.
- Examples: Int_Flight, Loc_Flight.Lbl1
- 6. In most cases, upper and lowercases are read differently. A
and a may hold different data
2. 3. LEARNING OBJECTIVES
- After the report the students should be able to:
-
- Define what constants are
-
- Explain the meaning and use of operators
-
- Learn and evaluate arithmetic operators properly
-
- Learn and use relational opeartors
-
- Define and use logical operators
4. 5. CONSTANTS
- Constants are values that do not change during the execution of
the program.
6. 7. OPERATORS
- Anoperatoris a symbol or a character indicating an operation
that acts on one or more elements. These elements are refered to
asoperands
8. OPERANDS
- An operand is the object of a mathematical operation or a
computer instruction. The number of operands depends on the
programming language you use.
- Pascal Programming Language contains constants, data,
variables, and other arithmetic expressions .
9. CLASSIFICATION of OPERATORS
10. Arithmetic Operators
- They are operators that perform mathematical operations or
calculations
- It can involve two or more numeric arguments (operands)
- These operators are similar to what the 4 fundamental
operations
11. FUNCTION OPERATOR Addition + (plus sign) Subtraction -
(minus sign) Multiplication * (asterisk) Division / (slash) Modular
Division/ Modulus mod Integer Division div Exponentiation ^ (caret
sign) Negation - (minus sign) 12. + and -
- + operators are just the same as addition in real life as well
as subtraction
- - operators are just the same with the real life
subtraction
13. * and /
- Just like the addition and subtraction operational principle;
multiplication is just the same
- Just like the addition and subtraction operational principle
division is just the same
14. Div
- It computes ONLY the integral part of the result of dividing
its first operand to its second operand
- An integral part is defined as an integer or whole number such
as 1, 10, or 5
2 7 2 3.5 1 7 div 2 15. Mod
- Modulus returns the integer remainder of a division.
2 7 2 3 1 7 div 2 7 mod 2 16. ^ and -
- Exponentiation is self explanatory. It only means that a number
can be expressed with an exponents
- Negation makes a number in its negative form
17. HEIRARCHY of ARITHMETIC OPERATIONS
- It is also called OPERATOR PRECEDENCE. It refers to the
priority of the various operators when more than one is used in an
expression. Parenthesis are used as the need arises.
18. EXPRESSION
- Expression in programming, is a combination of symbols,
identifiers, values and operators that yield a result upon
evaluation
19. NEMDASMo Method
- 3 rd :Multiplication and Division
- 4 th : Addition and Subtraction
20. Example:
21. LESSON TERMS
22.
- Write your answers in a one whole sheet of paper. Copy the
given values and variables.
23. VALUES and VARIABLES
24.
25. PLEASE EXCHANGE NOTEBOOKS to YOUR CHEATMATES 26. Assignment
Operators
- Is used to assign values to variables. You can assign any type
of data to a variable, real, integer, char and boolean.
- The sign for assignment operator is :=
27. Assignment Statements
- It always consist of a variable on the left hand side of an
assignment operator, and an expression on a right side
- The expression can be a variable, a number, or any complicated
expression made up of variables, numbers and arithmetic
operators
- It instructs the computer to evaluate the expression and assign
value of its result to the variable
- Form: Variable := Expression
28. Illustrative Example
VARIABLE EXPRESSION ASSIGNMENT OPERATOR 29.
- This statement would assign the product of the expression N1*N2
to the variable PROD. Since the value of a variable can be changed
during the program execution, the value of the variable PROD could
also change depending on the value stored in any of the two
variables N1 and N2
30. Example
31.
- The number 6 there is assigned to the variable X, then in the
fourth statement, the variable X is assigned to the variable Y
32. A variable on the right-hand side of an assignment statement
must first be given a value before it can be used in an assignment
statement. A variable without an assigned value is called
anuninitialized variable 33. Relational Operators
- Operators that are used to compare two values basing on certain
conditions.
- yield a true or false result
- Form:value| relational operator | value
- The operands of a relational operator must be of the same data
type, or one maybe type real and the other type integer
34. FUNCTION OPERATOR Greater than > Less than < Equal to
= Not equal to Greater than or Equal to >= Less than or Equal to
5 True8=10 False What happened here was atype mismatch 8 (C*B)
42. PLEASE EXCHANGE NOTEBOOKS to YOUR CHEATMATES
- X*Y*W*Z := Total := ExtremeTotalityorTotal :=
ExtremeTotality
43. PLEASE EXCHANGE NOTEBOOKS to YOUR CHEATMATES
- (60,000) > (60, 000)FALSE
44. Logical Operators
- They are also called as Boolean Operators
- Boolean operators are operators that evaluate expressions and
determine whether the conditions specified by the expressions are
either true or false
- Requires boolean operators
45. KINDS OF BOOLEAN OPERATOR
46. The AND Operator
- The and operatorevaluates totrue , only if both its operands
(or expressions) are true.
47. (X> 75) and (Y>75) 48.
- If both expressions (X > 75) and (Y >75) include in the
statement evaluate to true(if both X and Y values are greater than
75), then the above statement will evaluate totrue , otherwise, the
statement will evaluate tofalse .
49. AND Operator Operand / Expression 1 Operand/ Expression 2
Decision True True True True False False False True False False
False False 50. ILLUSTRATIVE EXAMPLE
51. ILLUSTRATIVE EXAMPLE
58. The NOT Operator
- The NOT Operator has a single operand which it evaluatesto
either true or false.
- It returns the opposite of the value returned by the
variable
59. If passed is true, then not passed is false If passed is
false, then not passed is true 60. NOT Operator Operand /
Expression 1 Operand / Expression 2 Operand / Expression 1 Decision
Operand / Expression 2 Decision True True False False True False
False True FalseTrue True False False False True True 61. OPERATOR
PRECEDENCE OPERATOR PRECEDENCE Not *, /, div, mod, and + , -, or
Highest (evaluated first) Lowest (evaluated last) 62. LESSON
TERMS
63. In your notebook 64. Determine the Boolean values returned
by the following operators with the given values
- (not condition) and (not flag)