computer programming (Program Bug and Problems)

by Asy, Sunday, March 17, 2013, 15:54 (1534 days ago)

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% .


Complete thread:

 RSS Feed of thread

powered by my little forum