Assessment: Lecture Activity # 1 - Problem Analysis
Assessment: Lecture Activity # 1 - Problem Analysis
Assessment
“ Be Original and Don’t Plagiarize”
Name: Cleofas, Vince Joseph R. _____ Year Level: 1st year BSIT
Section: CEIT-37-101P___________ Date: Oct, 8 2021
1.1 Suppose you want to create a program that would accept any number and computes the
square, and square root the number read.
PROGRAM PLAN
Required Output Program that computes the square and square root of any read
number
Algorithm
1. Start
2. Declare num1
3. Print “enter number: “
4. Input num1
5. To compute square, multiply num1 and num1, call it as
num2
6. To compute square root, sqrt(num1), call it as num3
7. Print “square = “
8. Print “num2”
9. Print “square root =”
10. Print “num3”
11. End
1.2 Input three (3) integer numbers, then calculate and output their sum and the average.
PROGRAM PLAN
Required Output
Sum and Average of 3 integers
Available Input
num1, num2, num3
Processing Requirements
sum = num1 + num2 + num3
avg = sum / 3
Algorithm
1. start
2. Declare num1, num2, num3, sum, avg
3. Print “Enter 3 integers”
4. Input num1
5. Input num2
6. Input num3
7. To compute sum, add sum1, sum2, and sum3, call it as sum
8. To compute average, multiply sum and 3, call it as avg
9. Print” sum = “
10. Print sum
11. Print “Average =”
12. Print avg
13. end
1.3 A store owner wants to give a 10% discount to customers who are 60 years old and above.
PROGRAM PLAN
Required Output A customer who will receive 10% discount
Available Input Age–A
Amount of Purchase–AP
Discounted Amount of Purchase-DAP
Discount-D
Processing Requirements Discounted Customers = Age > 60
No discount customers = Age < 60
Discounted amount of purchase = Amount of
purchase * .10, and subtract the product to the amount of
purchase
Algorithm
1. Start
2. Declare variables A, AP, DAP, D
3. Print “Enter Age:”
4. Input A
5. Print “Amount of purchase:”
6. Input AP
7. If A is greater than 60, multiply AP to .10, call it as
(D)
8. Subtract the D to AP, call it as (DAP)
9. Print DAP
10. Else A is less than 60, Print “No discount”
11. End
A company pays an annual bonus to its employees. The bonus is based on the number of years the
employee has been with the company. Employees working at the company for less than 5 years receive a
1% bonus while the rest will receive a 2% bonus. Bonuses will also be based on the employee’s annual
salary.
PROGRAM PLAN
Required Output Employees who will receive 1% and 2% annual bonus
Algorithm
1. Start
2. Declare variables AS, EWY, TSB
3. Print “Enter annual salary”
4. Input AS
5. Print “Enter the employees working years”
6. Input EWY
7. If EWY > 5, or = 5, multiply the AS to .02, call it as (OB)
8. Subtract OB to AS, call it as (TSB)
9. else EWY < 5, multiply AS to .01, call it as (TB)
10. Subtract TB to AS, call it as (TSB)
11. Print TSB
12. End
Lecture Activity # 3 – Design Tools (Algorithm)
Instructions: Create a program plan and algorithm for the following case and write your answer on the table
provided.
A company pays an annual bonus to its employees. The bonus is based on the number of years the
employee has been with the company. Employees working at the company for less than 5 years receive a
1% bonus while the rest will receive a 2% bonus. Bonuses will also be based on the employee’s annual
salary.
PROGRAM PLAN
Required Output Employees who will receive 1% and 2% annual bonus
Algorithm
1. Start
2. Declare variables AS, EWY, TSB
3. Print “Enter annual salary”
4. Input AS
5. Print “Enter the employees working years”
6. Input EWY
7. If EWY > 5, or = 5, multiply the AS to .02, call it as (OB)
8. Subtract OB to AS, call it as (TSB)
9. else EWY < 5, multiply AS to .01, call it as (TB)
10. Subtract TB to AS, call it as (TSB)
11. Print TSB
12. End