Sie sind auf Seite 1von 14

Katrina Coleen C.

Carpio
BSA 4 2

1. Create a flowchart that will compute the area and perimeter of a square.























Start
SIDE = 0
AREA = 0
PERIMETER = 0
Input SIDE
Area = SIDE * SIDE
Perimeter = 4 * SIDE
Print The AREA is , area
Print The PERIMETER is, perimeter.
End
Let SIDE be the side of the square.
Let AREA be the area of the
square.
Let PERIMETER be the perimeter
of the square.

2. Create a flowchart that will input two numbers and display the sum, product, and
difference.





















Start
N1 = 0 PRODUCT = 0
N2 = 0 DIFFERENCE = 0
SUM = 0
Input N1, N2
SUM = N1 + N2
PRODUCT = N1 * N2
DIFFERENCE = N1 N2
Print The SUM is , sum
Print The PRODUCT is, product.
Print The DIFFERENCE is, difference.
End
Let N1 be the 1
st
number.
Let N2 be the 2
nd
number.
Let SUM be the sum.
Let PRODUCT be the product.
Let DIFFERENCE be the difference.


3. Input age and display you can vote if age is 18 above otherwise display you cannot vote.






















Start
AGE = 0
Input AGE
AGE > = 18
Perimeter = 4 * SIDE
End
Print You cannot vote
Print You can vote
YES
NO

4. Input a number and display if it is in positive or negative. Assumption : 0 is considered
negative.





















Start
N = 0
Input N
N > 0
Perimeter = 4 * SIDE
End
Print NEGATIVE
Print POSITIVE
YES
NO

5. Input a number and display if it is odd or even.






















Start
N = 0
Input N
N mod 2 = 0
Perimeter = 4 * SIDE
End
Print ODD
Print EVEN
YES
NO

6. Input a number except 0, display if it is in positive or negative.






















Start
N = 0
Input N
N > 0
Perimeter = 4 * SIDE
End
Print NEGATIVE
Print POSITIVE
YES
NO
N = = 0
Perimeter = 4 * SIDE
NO

7. Print numbers from 1 to 5.
NOTE : If counter starts with 0





















Start
COUNTER = 0
Print COUNTER
COUNTER = COUNTER + 1
COUNTER = = 5
End
Increment counter by 1
NO
YES


NOTE : If counter starts with 1





















Start
COUNTER = 1
Print COUNTER
COUNTER = COUNTER + 1
COUNTER = = 6
End
NO
YES
Increment counter by 1

8. Input 5 numbers and display the sum.






















Start
COUNTER = 0
N = 0
SUM = 0
Input N
COUNTER = COUNTER + 1
COUNTER = = 5
NO
YES
SUM = SUM + N
Print The SUM is
End
Increment counter by 1


9. Flowchart that prints multiples of 10 from 1000 to 200.






















Start
COUNTER = 1000
Print COUNTER
COUNTER = COUNTER 10
COUNTER = = 190
End
NO
YES
Decrement counter by 10

10. Flowchart that prints multiples of 5 from 25 to 75.






















Start
COUNTER = 25
Print COUNTER
COUNTER = COUNTER + 5
COUNTER = = 80
End
NO
YES
Increment counter by 5

11. Input 5 numbers and display the product.






















Start
COUNTER = 0
NUMBER = 0
PRODUCT = 1
Input NUMBER
PRODUCT = PRODUCT * NUMBER
COUNTER = COUNTER + 1
COUNTER = = 5
End
NO
YES
Increment counter by 1

Print The PRODUCT
is, product.

12. Input 10 numbers and display how many numbers are greater than 5.






















Start
COUNTER = 0
NUMBER = 0
CTR_G = 0
Input NUMBER
COUNTER = = 10
NO
YES
COUNTER = COUNTER + 1
Print There are, CTR_G
End
NUMBER > 5
NO
YES
CTR_G = CTR_G + 1
Let COUNTER counts the input number.
Increment counter by 1
Let CTR_G counts the input numbers
greater than 5.

13. Print numbers from 26 to 59, display how many numbers were generated.
Start
COUNTER = 25
CTR_G = 0
COUNTER = COUNTER + 1
CTR_G = CTR_G + 1
COUNTER = = 59
NO
YES
Print COUNTER
Print There are, CTR_G
End
Increment counter by 1
Let CTR_G counts the numbers
generated.