PROGRAMMING LOGIC AND DESIGN
CPE 2 – 1ST SEM 2020-2021
MIDTERM GRADING PERIOD
ASSIGNMENT #1
PROFESSOR: FREDDIE M. TAMAYAO, MENG-CPE, CISSP
NAME: Ivan Webster J. Razo DATE: September 12, 2020 TIME: ____9:43 PM___
ACTIVITY PROBLEM #1:
Flowchart that used to input two numbers and display the product and quotient.
START
Variables num1,
num2, product,
quotient
Input num1
and num2
product = num1 * num2
quotient = num1 / num2
Output var.
product and
quotient
STOP
ACTIVITY PROBLEM #2:
Flowchart that used to enter three integers and display the sum, difference, product and quotient.
START
Variables int1, int2,
int3, sum, diff,
product, quotient
Input int1,
int2 and int 3
sum = int1 + int2 + int3
diff = int1 - int2 - int3
product = int1 * int2 * int3
quotient = int1 / int2 / int3
Output var. sum,
diff, product and
quotient
STOP
ACTIVITY PROBLEM #3:
Flowchart that used to enter four numbers and display the sum and average
START
Variables num1,
num2, num3, num4,
sum and avg
Input num1,
num2, num3,
and num4
sum = num1 + num2 + num3 + num4
avg = sum / 4
Output var. sum
and avg
STOP
ACTIVITY PROBLEM #4:
Flowchart that enters two numbers and determine which is the bigger one.
START
Variables num1 and
num2
Input num1
and num2
Is num1 > Output
TRUE
num2 ? “num1 is
greater than
num2”
FALSE
Output
“num2 is
greater than
num1”
STOP
ACTIVITY PROBLEM #5:
Flowchart that will input five grades then compute the average and determine whether the average is
“PASSED” or “FAILED”. If the average is greater or equal to 60 then display the remarks “PASSED”,
otherwise “FAILED”.
START
Variables gr1, gr2,
gr3, gr4, gr5 and avg
Input gr1,
gr2, gr3, gr4
and gr5
avg = (gr1 + gr2 + gr3 + gr4 + gr5) /4
TRUE
Is avg >= TRUE
Output
60 ?
“PASSED”
FALSE
Output
“FAILED”
STOP
ACTIVITY PROBLEM #6:
Flowchart that will input five item price and compute for the Total Price. If the total price is greater than
one thousand pesos then discount is ten percent of the total price otherwise five percent only. Display
Ivan Webster J. Razo
the discounted total price. September 9, 2020
CpE-1
START
Variables itm1, itm2,
itm3, itm4, itm5,
sum, and discntd
Input itm1,
itm2, itm3,
itm4, itm5
sum = itm1 + itm2 + itm3 + itm4 + itm5
TRUE
Is sum > TRUE Output
1000 ? “10 %
Discount”
FALSE
discntd = sum * 10 / 100
Output
“5%
Discount”
discntd = sum * 5 / 100
Output
“discntd”
STOP