2/4 If statements


#1

in line 7:
$items = 5; // Set this to a number greater than 5!
I think he means:
$items = 5; // Set this to a number less than 5!


#2

The comment is correct. You really need number greater than 5. On line 7 you are setting $items to 5. 5 is not greater than 5. Try with 6, 7, 8, etc.

But you also need to change the condition. To print out "You get a 10% discount!" just edit "<" to ">" and the code will work fine.

Read the instructions carefully:
...
2. On line 9, edit the condition so that your program will print out You get a 10%
discount!


#3

I had to put a number lesser than 5


#4

i did tas u said and the output is printed as "You get a 10% discount " but when i click on save and submit code then "**_Oops, try again. It looks like your code didn't print 'You get a 10% discount!' Make sure you set $items to a number greater than 5." is shwoing.
what should i do to move to next chapter.
please help


#5

Maybe you miss the "!" in the end?


#6

In order to sufficiently help you with your error, it would be beneficial to add a screenshot of your code.


#7

A post was split to a new topic: 2. Did you accidentally change the condition?


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.