You are on page 1of 4

Karl Lewin M.

Babatla

BSCpE- 1A

1. BODY MASS INDEX

PSEUDOCODE

Module Main()

Declare Real height, weight, BMI

Display “Enter person’s information: ”

Display “height in meters? ”

Input height

Display “weight in kilogram? ”

Input weight

Set BMI = weight / height * height

End module

Module showBMI(Real BMI)

Declare Real BMI

Display “Enter your BMI: ”

Input BMI

If BMI < 18.5 Then

Display “underweight”

Else

If BMI > 18.5 And BMI < 24.9 Then

Display “normal”
Else

If BMI > 25 And BMI < 29.9 Then

Display “overweight”

Else

If BMI > 30 Then

Display “obese”

End If

End If

End If

End If
2. SOFTWARE SALES

PSEUDOCODE

If quantity >= 100 Then

Set DiscPercent = 50

Else

If quantity >= 50 Then

Set DiscPercent = 40

Else

If quantity >= 20 Then

Set DiscPercent = 30

Else

If quantity >= 10 Then

Set DiscPercent = 20

Else

If quantity <= 0 Then

Set DiscPercent = 0

End If

End If

End If

End If

End If
Set DiscountAmount = DiscPercent * 99 * quantity

Set PriceAfterDisc = 99 * quantity – DiscountAmount

Display “The amount of discount is ”

Display “The discounted price is ”

3. DEBUGGING

The problem is in the second line. The “if NOT temp” if the error or the problem it must be “If temp”. and also
the operator must be “≠” not “==”.

You might also like