CSS 11_Quarter1_Module1
CSS 11_Quarter1_Module1
of Computers,
Operating
Systems, and
Peripheral
Devices
2
Programming
16
1 + 4 to get 5 2 + (2 x 5) = 12
Solution:
2 + 5 + 5 to reach 3 + (3 x 6) = 21
12
8 + (8 x 11) = 96
3 + 6 to 12 gives
21
8 + 11 + 21 = 40
17
Programming
solving 1. 2.
1. How many 2.
apples? 1. Count the of
Solution: apples of Juan
Count the number 2. Count the apples
of apples, (add) of Mary
3. Add the apple of
Juan and Mary
20
Programming
solving
3. 4. 5.
process
Implement the Verify that the Maintain the
involves the
algorithm in a algorithm works. program by
following
programming improving it, and
steps:
language, such as modifying it if the
Java. problem domain
changes.
21
Generation of
Programming
Languages
22
First
Generation These are low-
level languages
like machine
language.
23
Languages
25
○ It is easy to modify.
Compilers
39
Algorithms
and
Flowchart
1. discuss the importance of algorithm in
problem solving;
Learning
2. compare the use of flowchart and
Outcomes pseudocode;
Lesson
Map Pseudocode Flowchart
Algorithm
Example of
Algorithm
47
Stop
59
○ Pseudocode
1. Go to IT Dept
Fill up form
Pseudocode 2. Fill up Form.
3. Proceed to EDP
and Flowchart
4. Submit Proceed to
Requirements. EDP
5. Proceed to cash.
6. Go back to EDP. Submit
Requirements
A
61
Proceed to
Cash
Go back to
EDP
62
Flowchart
Flowchart
Symbols:
Flowchart
Symbols:
Start
65
L,W,
Sequential: ◦ Input: Length, Width A
Calculate the ◦ Variables: L, W
area of ◦ 1. Get the value of L and W. Get L, W
rectangle.
◦ 2. Multiply L and W
A=LxW
◦ 3. Assign the result to variable
A=LxW
A.
◦ 4. Display A.
Display A
Stop
66
○ Compute the area of rectangle.
A, P
Stop
68
Start
Create a
○ Input: age
flowchart that
will display ○ Process:
age
your age five ◦ age = age +
years from 5
now. ○ Output: age Get age
age = age + 5
A
69
age
Stop
70
start A
X, Y
INPUT PRINT X, Y
PROCESS
GET X, Y
OUPUT
stop
X=X+Y
Y=X-Y
X=X-Y
A
Start
A 71
A
Start
72
○ Input: p,m,pf,
Draw a flowchart
f,gpa
that will compute ◦ p,m,pf,f
you GPA. GPA is
○ Process:
computed as GPA = Get
(prelim + midterm ◦ GPA = c p,m,pf,f
+ prefi + final)/4
○ Output:
gpa=GPA = (prelim +
◦ GPA midterm + prefi + final)/4
Display
gpa
Stop
73
Conditional else Do
Structure Task-B
Types of
○ if Structure: Executes the
Selection/
statement when the condition is
Conditional
true
Structure True Is today False
sunny
day?
Go out with
friends
77
○ if else Structure: Executes two different
Types of codes depending upon whether the test
Selection/ expression is true or false.
Conditional
Structure True Is today False
a sunny
day?
Go out with
friends True Is today False
Monday
?
◦ || (or) Y=5
◦ ! (not) X != Y
10 !=5
81
○ !False = True
○ !True = False
NOT
84
○ Input: age
Create a
flowchart that
○ Output: age
Display “Can
Vote”
STOP
START 86
○ Input: age
○ Condition: age
Create a flowchart
that will increment ○ age == 20
the age by 10 if the ○ Process: Enter age
age is equal to 20
otherwise do ◦ age = age + 10
nothing. ○ Output: age False age True
==20
age = age + 10
age
STOP
Start
87
○ Input: age = 17
○ Condition: age < 18 age
Draw a flowchart that
will print “Cannot ◦ True: “Cannot
vote” if age is less Vote”
Get age
than 18 otherwise
◦ False: “Can Vote”
print “Can Vote”
True False
age
<18
Stop
Start Start
88
“Positive” or
“Negative”.
True num False True num False
>0 <0
○ Input:
number “Positive” “Negative” “Negative” “Positive”
○ Condition:
○ number>0
○ number<0 Stop Stop
89
○ Input:
Create a age
◦ age = 20
flowchart that ○ Output:
will print “Can
◦ “Can vote “
vote ” if age is Get age
○ Process:
greater than or Condition:
equal to 18. ◦ age >= 18 False age>= True
18
“Can Vote”
STOP
START
91
○ Input: age
Create a flowchart
◦ age
that will increment
○ Condition: Get age
the age by 10 if the
◦ age == 20
age is equal to 20
○ Process: False
otherwise do nothing. True
age ==
◦ age = age + 20
10
○ Output: age = age + 10
◦ age
Print age
STOP
START
92
○ Input:
age
Draw a flowchart that ◦ age = 3
○ Condition:
will print “Cannot
vote” if age is less ◦ age<18 Get age
STOP
START
START
93
○ Input:
num
A program that ◦ num num
○ Condition:
determines if the
◦ num<0 Get num
Get num
input number is
◦ num>0
“Positive” or ○ Output:
False True False
“Negative”. ◦ Positive num < 0 num >
0
◦ Negative
“Positive” “Negative”
“Negative”
STOP
STOP
Start A 94
95
sale,
Create a flowchart com
that will compute for
commission. If sale is
greater than or equal Get sale
to 20000,
commission is 20% of
the sale. Otherwise, True Sale >= False
commission is 10%. 20000
○ Input: sale
○ Output: commission com=sale*0.20 com=sale*0.10
○ Condition:
◦ sale>=20000 com com
◦ True: commission
= sale * 0.20
◦ False: commission
Stop
= sale * 0.10
○ A flowchart that displays the high school level of a student, based
96
on its year entry.
Year Entry Number High School Level
1 “Freshmen”
If else if
2 “Sophomore”
Structure 3 “Junior”
4 “Senior”
Example ○ Write a flowchart that will compute customer’s payment.
Customers’ payment can have discounts or interest based on the
mode of payments. The following are the mode of payments:
Mode of Payment Discount/Interest
1 10% discount (Cash)
2 5% discount (Two Installment)
3 5% Interest (Three-Installment)
None of the above Invalid Input