computer programming (Program Bug and Problems)

Hi.May you help me with question given.

Determine price after discount. Based on data price entered by user. The discount structure is :

price below and equal 100 : discount = 0%

price between 100 and 200: discount = 10%

price above and equal 200: discount = 20%

this is my solution:>
print "what is the price (RM)?"
input P
If P<=100 Then
PE=(0/100)*P
Endif
If 100<P<200 Then
PE=(10/100)*P
Endif
If P>=200 Then
PE=(20/100)*P
Endif
P=P-PE
print "The price is " +P

I don't know where is my fault.I calculated the price for P<=100 (
price below and equal 100 : discount = 0%) but I got the price is for
price between 100 and 200: discount = 10% .

computer programming

CLS
J = 0
K = 0
T = 0
print "what is the price (RM)?"
input P
If P <= 100 Then T = P
IF P > 100 THEN J = 1
IF P <= 200 THEN K = 1
IF J = 1 AND K = 1 THEN T = P - (10*P) / 100
If P > 200 Then T = P - (P * 20) / 100
print "The price is = " + T
END

thanks :)

computer programming

If 100<P<200 Then

Here's what happens:

-The program will decide whether or not 100 is less than the price (P).
-This will return a binary flag, either true (1) or false (0).
-The program then decides whether or not the flag (1 or 0) is less than 200.
-This is always true, so PE is set to 1/10th of P regardless of what P equals.
-If P is greater than 200, PE is set to 1/5th of P.

Replace the line with:

If 100<P and P<200 Then

I hope this helps you in the future!