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 Daily Exercise Program Conditionals

George Boyajiev
George Boyajiev
137 Points

GRANDE STUPID

...

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";
}else{
    echo $studentOneName . " has a GPA of GPA";
}

echo "<br />";


if($studentTwoGPA == 4.0){
    echo $studentTwoName . " made the Honor Roll";
}else{
    echo $studentTwoName . "has a GPA of GPA";
}



?>
Corina Meyer
Corina Meyer
9,990 Points

I think you shall replace the last "GPA" with the student's gpa. the challenges text is a bit confusing.

George Boyajiev
George Boyajiev
137 Points

Yes, exactly... Thanks :)

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi! The difficulty you are experiencing lies mainly in what is being echoed out. In the case that a student did not get a 4.0 it should echo the name of the student plus a message that contains their actual GPA. In the first example it should echo out "Dave has a GPA of 3.8". But you're echoing out "Dave has a GPA of GPA".

As a side note, your questions are more likely to be answered here on the Community by fellow students if they actually contain a well-formulated question.

Good luck! :sparkles:

Hi George,

The problem is what Corina pointed out and

echo "<br />";

In between your parts of code. These challenges are very specific in how they wanted things formatted as this one can be answered/done a lot of different ways.