Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP PHP Basics Daily Exercise Program Conditionals

Brian Taylor
Brian Taylor
1,313 Points

I'm pretty sure my solution is doing what is asked, but isn't being accepted. It's keeping me from moving on..

Do the variables need to be concatenated in some specific way? It would help if we could see the code that is being run as the test so I can see why I'm failing.

The error message is "Use the Variables to output the message", which I am doing.

index.php
<?php
$studentOneName = 'Dave';
$studentOneGPA = 3.8;

$studentTwoName = 'Treasure';
$studentTwoGPA = 4.0;

//Place your code below this comment
  if ($studentOneGPA == 4.0) {
    echo "$studentOneName made the Honor Roll \n";
    } else {
    echo "$studentOneName has a GPA of $studentOneGPA \n";
    };

  if ($studentTwoGPA == 4.0) {
  echo "$studentTwoName made the Honor Roll";
  } else {
  echo "$studentTwoname has a GPA of $studentTwoGPA \n";
  };
?>

2 Answers

Steven Parker
Steven Parker
217,419 Points

You've got it, except for a little typo on the last line where you have "$studentTwoname" (lower case "n") instead of "$studentTwoName" (upper case "N").

Brian Taylor
Brian Taylor
1,313 Points

Thanks!

I caught that but then couldn't find a way to get to my question to update it! I appreciate the look :)

Steven Parker
Steven Parker
217,419 Points

Did you try selecting "My Posts" instead of "Newest" in the box next to the Search line?

Brian Taylor
Brian Taylor
1,313 Points

The 'get help' flow never directed me to the community area, just from submitting my question back to the challenge.

I'd never submitted a question before so hadn't realized I needed to navigate to the community area to look for it,

Makes sense now though! Thanks.