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

dont get it ..what is wrong..

Can not figure out what is wrong.

index.php
<?php

//Place your code below this comment
$integerOne = 1;
$integerOne = 1 + 5;
var_dump ($integerOne);
$integerTwo = 2;
$integerTwo = 2 - 1;
var_dump ($integerTwo);
$floatOne = 1.5;
var_dump ($integerOne * $floatOne);
?>

sorry..it asks me to multiply integer one with float one without changing values. dont understand what they mean by without changing values? i am not changing them..i am simply multiplying them so whats wrong? thx

1 Answer

Nish Patel
Nish Patel
1,103 Points

The task requires you to use += and -= operators. Don't worry hang in there, practice makes perfect!

//Place your code below this comment
//Task 1
$integerOne = 1;
$integerTwo = 2;
//Task 2
$integerOne += 5;
$integerTwo -= 1;
//Task 3
$floatOne = 1.5;
echo $integerOne * $floatOne;
?>

Thx Nish for such fast answer. I thought i will wait for weeks :D . Anyway as you wrote += stuff..i wrote that too earlier..after could not fight 3rd task was just playing around with tasks 1 and2 ..statement about not changing values kinda trapped me in corner.. i guess i focused on that part of question too much. Dont remember in videos about variables and operators that i can simply write arithmetic action just with variables without putting a var_dump before or without creating a new variable for equation to multiply integerone and floatone But maybe i missed somthing. I was thinking to return and try to create new variable..do a equation and then echo it with new variable name. But i guess that would be wrong too. Thx very much again!