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 trialNicolas Daniel
Courses Plus Student 3,030 PointsPHP Basic Manipulating Numbers
Getting a bummer response stating that $floatOne value is not set to 1.5
<?php
//Place your code below this comment
$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;
$integerOne += 5;
$integerTwo -= 1;
$floatOne *= $integerOne;
?>
3 Answers
Jennifer Nordell
Treehouse TeacherHi there! Tobias Krause is correct. You've forgotten to echo the result. However, it wants you to do this without overwriting the original values of either $floatOne
or $integerOne
. Overwriting the values will cause the challenge to fail even if the echo would otherwise be correct. So the last line needs to be removed and your echo can display the results directly. Take a look here:
<?php
//Place your code below this comment
$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;
$integerOne += 5;
$integerTwo -= 1;
echo $floatOne * $integerOne;
?>
Hope this helps!
tobiaskrause
9,160 Points$result = $floatOne * $integerOne;
echo $result
You need to display the value of the result. Also
$floatOne *= $integerOne;
increases the value of $floatOne which was not part of the instructions Assign the value of the multiplication to a new varaible since you can not use $integerOne because it is an integer. But the result of a multiplication of integer and float is float. So the variable with the result must be a float.
Nicolas Daniel
Courses Plus Student 3,030 PointsThanks Tobias It worked well!
Nicolas Daniel
Courses Plus Student 3,030 PointsTobias and Jennifer Have you been able to solve the Date function Objective task as well as the Conditional objective task ?
Jennifer Nordell
Treehouse TeacherI have completed the course you're working on. So, yes. But if you have a question about another challenge, I'd highly suggest posting it as an entirely new question in the forums. This way the question will be properly linked with the challenge in question and help other students find the answer more easily
Nicolas Daniel
Courses Plus Student 3,030 PointsNicolas Daniel
Courses Plus Student 3,030 PointsThanks a lot Jennifer Nordell that worked!
tobiaskrause
9,160 Pointstobiaskrause
9,160 PointsOh ...yeah thats the smarter way :) I was more focused about that he wanted to set an float value to an integer. The other way around is completely fine of course. (Actually the challange did not even say to assign or change values to/of variables. Seems the callanges are not so sensitive as i thoguht)