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

i input right, but it doesnt let me proceed on task 3 https://teamtreehouse.com/library/php-basics-2/unit-converter/mani

https://teamtreehouse.com/library/php-basics-2/unit-converter/manipulating-numbers

task 3 $floatOne = 1.5; $integerOne = $integerOne * $floatOne; echo $integerOne;

index.php
<?php

//Place your code below this comment
//task 1
  $integerOne = 1;
  $integerTwo = 2;

//task two
  $integerOne += 5;
  $integerTwo -- ;

  echo $integerOne;
  echo $integerTwo;

//task 3
 $floatOne = 1.5;
  $integerOne = $integerOne * $floatOne;
  echo $integerOne;
?>
stevenpurvis
stevenpurvis
3,485 Points

The questions states without changing the values of the variables.

You are changing the value of $integerOne $intergerOne used to equal 6 now it equals 9

<?php

//Place your code below this comment
//task 1
  $integerOne = 1;
  $integerTwo = 2;

//task two
  $integerOne += 5;
  $integerTwo -=1 ; //for some reason I don't think it likes --  use -=1 instead it might be because of the space $integerTwo-- might work but then again I don't think that's the way it's taught in the videos 

  echo $integerOne;
  echo $integerTwo;

//task 3
 $floatOne = 1.5;
 echo $integerOne * $floatOne; //only the results are printed the values of the variables haven't changed.
?>

Hope this helps

2 Answers

Matthew Carroll
Matthew Carroll
10,448 Points

The challenge asks you to do this without changing the value of $integerOne. Echo the product of the multiplication directly

<?php
echo $integerOne * $floatOne;
?>

You will also need to comment out or remove the echos from Task 2, as they will prevent Task 3 from passing if they are present.

thank you