PROGRAMMING LOGIC AND DESIGN
CPE-1 – 1ST SEM 2020-2021
MIDTERM GRADING PERIOD
SEATWORK #2
PROFESSOR: FREDDIE M. TAMAYAO, MENG-CPE, CISSP
NAME: Ivan Webster J. Razo DATE: October 1, 2020 TIME: ____________
1. Algorithm to find Area and perimeter of a square
Step 1: Start
Step 2: Input a as value of side
Step 3: A = a * a
Step 4: Print A as area of square
Step 5: P = 4 * a
Step 6: Print P as perimeter of square
Step 8: Stop
2. Algorithm to find Area and Perimeter of a rectangle
Step 1: Start
Step 2: Input L as value of length
Step 3: Input W as value of width
Step 4: A = W * L
Step 5: Print A as area of rectangle
Step 4: P = 2 * (L + W)
Step 5: Print P as perimeter of rectangle
Step 6: Stop
3. Algorithm to find simple interest
Step 1: Start
Step 2: Input P as value of Principal
Step 3: Input R as rate of interest in percent
Step 4: Input T as time period of loan
Step 5: SI = (P * R * T/ 100)
Step 6: Print SI as simple interest
Step 7: Stop
4. Algorithm to find the smallest number of two numbers
Step 1: Start
Step 2: Input number1
Step 3: Input number2
Step 4: If number1 < number2
Step 5: Print number1 “is the smaller value”
Step 6: Else if number1 > number2
Step 7: Print number2 “is the smaller value”
Step 8: Stop
5. Algorithm to determine if student is qualified for scholarship. A student is qualified if the general
weighted average is greater than 90% and number of units enrolled was 30 units
Step 1: Start
Step 2: Input GWA as general weighted average
Step 3: Input U as number of units enrolled
Step 4: If GWA > 90 && U >= 30
Step 5: Print “Qualified for Scholarship”
Step 6: Stop
6. Algorithm to find odd numbers from 1 to n where n is a positive integer
Step 1: Start
Step 2: Set O to 1 as odd number counter
Step 3: Input 10 as a positive integer
Step 4: While (O <= 10)
Step 5: If (O%2 != 0)
Step 6: Print O
Step 7: O++
Step 8: Else if (O%2 == 0)
Step 9: O++
Step 10: Stop