1. Weekly Assessment # 2
Programming I
General Instruction: Write a flowchart of the following problems below. You may put your answers
here.
Example:
Problem: Add two numbers entered by the user.
Algorithm:
Declare variables n1, n2 and sum (Process)
Read the n1 and n2 (Input/Output)
Add them and store the result in sum (Process)
Display sum (Input/Output)
Answer:
START
Declare variables n1, n2 and
sum
Sum = n1 + n2
STOP
Read n1 and n2
Display sum
2. 1. Print a “Hello World” Program.
2. Determine if the number is a prime number.
3. Converts the input dollar to its peso exchange rate equivalent
Note: Dollar Rate – 58.88 Philippine Pesos
4. Calculate the return of investment.
Note: Return of Investment = (Vf – Vi)/Vi
Where:
R = Return
Vf = Final Value
Vi – Initial Value
5. Find the difference of two numbers entered.
6. Calculate the sum of the first twenty numbers.
7. Arrange the numbers x,y,z in ascending order.
8. Print a “Hello World Program” in 15 times.
9. Find the smallest among three numbers entered by the user.
10. Find the even numbers between 15 and 150.
Flow Chart
1. Hello World