Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJustin Lohman
287 PointsOops! It looks like Task 2 is no longer passing.
Why is Task 2 no longer passing?
<?php
//Place your code below this comment
$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;
$integerOne += 5;
$integerTwo -= 1;
$integerOne *= $floatOne;
echo $integerOne;
echo $integerTwo;
?>
2 Answers
Kieran Barker
15,028 PointsYour code for Task 3 should be:
echo $integerOne * $floatOne;
What you’ve done is assign the result of $integerOne * $floatOne
back into $integerOne
and then echoed $integerOne
and $integerTwo
.
Adam N
70,280 Points- You only need to echo one thing here
- You're not echoing the right thing
- Looks like the challenge wont accept a solution using the *= operator. Use regular multiplication instead
Let me know if this helps here
Justin Lohman
287 PointsHey Adam! Thank you for taking the time to reply man! The echo of $integerTwo was just me testing things in desperation trying to figure out why task two $integerOne += 5; and $integerTwo -= 1; was no longer valid. I did try using regular multiplication, but that didn't work either. You and Kieran got it right with your posts below - I was assigning the value of $integerOne * $floatOne to $integerOne, rather than just displaying the results of the multiplication problem. Ultimately, the problem was that the challenge course was telling me that Task 2 was no longer passing, but the truth was that I just didn't execute task 3 properly. Thank you so much for your help!
Adam N
70,280 Pointsnp! You can mark this question as solved by choosing a "best answer".
Adam N
70,280 PointsAdam N
70,280 PointsThis:
$integerOne *= $floatOne;
produces the same result as:
$integerOne * $floatOne;
Justin Lohman
287 PointsJustin Lohman
287 PointsYou nailed it bro! Thanks! (Ultimately, the problem was that the challenge course was telling me that Task 2 was no longer passing, but the truth was that I just didn't execute task 3 properly.) Thanks again!
Justin Lohman
287 PointsJustin Lohman
287 PointsThis is absolutely right! Thank you Kieran!