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 trial

PHP PHP Basics Unit Converter Manipulating Numbers

Where am I wrong? "Multiply $integerOne by $floatOne and display the results."

My code:

<?php

//Place your code below this comment

$integerOne = 1; $integerTwo = 2; $floatOne = 1.5;

echo $integerOne = $integerOne + 5; echo "<br>"; echo $integerTwo = $integerTwo - 1; echo "<br>"; $res = $integerOne * $floatOne;

print($res);

?>

index.php
<?php

//Place your code below this comment

$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;

echo $integerOne = $integerOne + 5;
echo "<br>";
echo $integerTwo = $integerTwo - 1;
echo "<br>";
$res = $integerOne * $floatOne;

print($res);

?>

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! You're doing terrific! You really are, but the previous two tasks didn't ask you to print anything. They only asked you to change the values. You went ahead and printed them and even formatted them nicely and everything! But this causes a problem when you get to step three as it is only expecting to see the number "9" printed to the page, but you have 6 1 9 printed there instead. Removing the additional echo statements causes this to pass all 3 steps so well done!

Hint :bulb: On these challenges, it's a great idea to try not to do anything the challenge hasn't asked for. Even if functional outside the challenge, it can cause the challenge to fail.

Hope this helps! :sparkles:

Thanks Jennifer

I got stuck on this as well. Is there a reason why the questions aren't progressive? The math from previous questions was required to make the question work, but we were only supposed to echo the last line. If that isn't said, how do you expect us to answer it? I worked on it for a long time -getting the correct answer and just got frustrated because I knew I was writing it correctly.

I'm trying to learn the code I should also have to try to learn how to get around your poorly worded questions.