ZILDJIAN XAVIER F.
LLAGAS
V. PRE TEST
True/False: This pre-test will try to assess your knowledge prior to the discussion of the topic. Each item
is a statement for you to evaluate whether true or false. Please put a check on the column that
corresponds to your answer.
ITEM TRUE FALSE
1. A typical programming task includes /
problem solving as the first phase.
2. An algorithm can presented both /
through pseudo code and flowchart.
3. A flowchart can jump to other page /
using on-page connector.
4. A high level language is very new to /
machine language and it’s quite
complicated because of symbolic code.
5. A variable name in programming /
cannot be composed of letters and
numbers
6. The appropriate data type for a /
variable that will store age of the
student is float.
7. Before a variable can be used in a /
program, it should be declared first.
8. The && (AND) operator results true if /
either of the operand is true.
9. The expression ((4>=4) && (8<=8)) is /
evaluated as true.
10. Applying the precedence of operator /
in C, the expression x=10+2*8/2-3 will
have a result x=45;
ZILDJIAN XAVIER F. LLAGAS
LEARNING TASK M1.2 Objective: This activity intends to achieve objective No. 4,5. Instruction: Following
the syntax of declaring a variable in C, declare your own variables with the following data (2 pts each):
1. id number of a student = int student ID;
2. quantity of an item = int number;
3. price of an item = float item price;
4. gender of a student = char gender;
5. salary of an employee = float int Salary;
6. value of a Pi = float value;
7. final grade of a student in five subjects = float student final grade
8. tuition fee of a student = float student tuition fee;
9. electric bill amount = float double bill;
10. middle initial of a student = char student/Middle initial;
Part 1: Evaluate the following expressions as to true or false based on the used operators.
Suppose a= 6, b c=3. (2 pts each)=7,
TRUE 1. (a <=b)
a = a<b
a = 6<7
TRUE 2. ! (a*b <= b*c)
! (a*b=a*b<b*c)
! (a*b=6*7<7*3)
! (a*b=42<21>
FALSE 3. ( (b=2) <= c)
( (b=2) <=c )
( (b=2=0 ) <=c )
( (7-22=5<=3 )
( (5 < = 3 )
TRUE 4. ! (a*b != b*a)
! (6*7 ! = 6*7)
! (6*7 != 6*7)
! ( 42! =42 )
FALSE 5. ! (c==3)
ZILDJIAN XAVIER F. LLAGAS
! (3= = 3
TRUE 6. (a<=b) || (b>=c)
( 6<=7)||(7>=3)
TRUE 7. (b!=c) && (c<=a)
(7!=3) &&(3<=6
TRUE 8. (b> c) && (c>a)
(7>3) %% (3>6)
TRUE 9. ! ((a>=c) || (b>=a))
!(( 6>7=3) || ( 7>=6)
FALSE 10. !(a<=b) || ! (b>=c)
! (6<=7) 11 ! (7)=3)
a.) x = 7+3*6/2-1 b.) x=2%2+2*2-2/2 c.) x=(3*9*(3+(9*3/(3) ) ) );
=7+18/2-1 x =2%2+4-2/2 x = (3*9*(3+(9*3/(3) ) ) );
=7+9-1 x=2%2+4-1 x= (3*9*(3+(27)/3) ) );
=61-1 x=2=4-1 x= (3*9*(3+9) );
X=15 x-6-1 x= (3*108)
X=5 x=324
VIII. Post-Test
1. TRUE
2. /TRUE
3. TRUE
4. TRUE
5. TRUE
6. FALSE
7. FALSE
8. FALSE
9. FALSE
10. FALSE
ZILDJIAN XAVIER F. LLAGAS
M.1
Pseudo code
1. Initialize ‘’student age’’ to 18;
2. Count student age;
3.if student _age is greater or equal to 18 print ‘’QUALIFIED’’ else
Print ‘’NOT QUALIFIED’’ end if
FLOWCHART
START
‘’Student Age’’
Print
‘’student age’’
Print
FALSE TRUE
Student
ages >or=
‘’not qualified’’
‘’qualified’’
Stop