You are on page 1of 5

HERRERA, FATIMA MARIE S.

October 19, 2022


PCEIT-02-101A CPE01
1. Write the pseudocode and the equivalent flowchart that will determine and print if an integer is
positive or negative. The user will input the value of the integer.

FLOWCHART
PSEUDOCODE
START START

Initiallized all the needed variables.

Input value of integer


Integer = 0
Integer = 0

If integer > 0

Then Print “POSITIVE”


Print “Input Integer”
Else

Print “NEGATIVE”

END
Read Integer

If integer > 0 Y
Print
“POSITIVE”

Print
“NEGATIVE”

END
HERRERA, FATIMA MARIE S. October 19, 2022
PCEIT-02-101A CPE01
2. Write the pseudocode and draw the flowchart that will compute for the customers senior
citizens discount in the store. If the customer is 60 years old and above the discount is 20% of
the gross amount. User will input the gross amount purchased and the age of the customer.

FLOWCHART PSEUDOCODE

START
START
Initiallized all the needed variables.

Input age of costumer

Discount = Gross Amount Purchased *20%


Print “Input Age”
If Age ≥ 60

Then, Discount = GAP * 20%

Else
Read Age
Discount = 0

End

N If age ≥ 60
Y

Discount = Gross
Discount = 0 Amount Purchased
*20%

END
HERRERA, FATIMA MARIE S. October 19, 2022
PCEIT-02-101A CPE01
3. Given a set of ten integers, determine how many are negative and how many are positive. Write
the pseudocode and draw the flowchart that will print the number of positive and negative
numbers given.

FLOWCHART PSEUDOCODE

START
START
Initiallized all the needed variables.

Input the integers

Print “Input the Count positive I


Integers”
Count negative I

Incriminate the count positive I + 1

Incriminate the count negative I + 1


Count Positive I = 0
If it less than of eqaul to 10, loop back and repeat step 3 to
Count Negative I = 0
If it is greater than 10 stop processing

Print the number of positive and negative integers

End
Count Positive I = 0 + 1

Count Negative I = 0 + 1

Count ≤ 10 N

Print the number of


positive and negative
numbers

END
HERRERA, FATIMA MARIE S. October 19, 2022
PCEIT-02-101A CPE01
4. Given 20 customers in a supermarket of varying ages, write the pseudocode that will compute
for the net amount to be paid. Senior citizens are given 20% discount on the gross amount. The
number of items, unit price, product name and age of the customers are inputted by the user.

FLOWCHART

START

Print “input age of


the costumer”

Costumer = 0

Costumer = 0 + 1

Discount = 0 If age ≥ 60 Discount =


GAP *20%

Net amount = (number Net amount = (number


of items *unit price) - of items *unit price) -
discount discount

Costumer ≤ 20

Print the value


of Net Amount

END
HERRERA, FATIMA MARIE S. October 19, 2022
PCEIT-02-101A CPE01
PSEUDOCODE

START

Initialized all the needed variable

Input the age of the costumer

Costumer = 0

Costumer = 0 + 1

If age ≥ 60

Then, Discount = Gross Amount Purchased * 20%

Then, Net Amount = (number of items * unit price) – discount

Else

Then, Discount = 0

Then, Net Amount = (number of items * unit price) – discount

If it is less than or equal to 20 costumers, loop back and repeat step 3 to 4.

If it is greater than 20 costumers stop processing.

Print the value of Net Amount

End

You might also like