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 trialJosie Fisher
484 PointsI'm not sure how it wants me to do these calculations...
Question : Add 5 to $integerOne. Subtract 1 from $integerTwo.
<?php
//Place your code below this comment
$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;
?>
2 Answers
jonathanbarrios
Treehouse Teacher👋 Josie Fisher,
First, you need to create three variables: $integerOne
, $integerTwo
and $floatOne
respectively. It seems like you got that part. The next two sections use the variables you created to perform simple math operations, like this:
$a = 1;
$b = 2;
$c = 1.5;
// Math operations using variables
$a = $a + 5;
// To subtract replace the + for a -
I hope this was enough of a clue to solve this challenge. Happy coding! 🙌
Sezare Miguel
9,229 Points//Place your code below this comment
$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;
$integerOne = $integerOne + 5;
$integerTwo = $integerTwo - 1;
?>```