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 trialVince Roszak
588 PointsCode Challenge
Having trouble on how i would do this
<?php
$studentOneName = 'Dave';
$studentOneGPA = 3.8;
$studentTwoName = 'Treasure';
$studentTwoGPA = 4.0;
//Place your code below this comment
if ( ) {
} else {
}
?>
2 Answers
Julian Gutierrez
19,201 PointsThat's a good start, your condition now needs to test if the student's gpa is equal to 4.0. If it's equal echo out the requested "Honor Roll" string. If it isn't equal, echo out the "has GPA" string. Do this twice, once for each student.
Matthew Bilz
15,829 PointsVince - try echoing out
"$studentOneName made the Honor Roll";
like that every time the student's name is supposed to be mentioned. Use the variable instead of a String Literal that has the variable's value.
Vince Roszak
588 PointsVince Roszak
588 PointsIm still stuck on it
Vince Roszak
588 PointsVince Roszak
588 Pointsthis is what i have so far