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

conditionals

am falling to understand the error on line 13

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

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

//Place your code below this comment
var_dump($studentOneGPA ==4.0);
var_dump($studentTwoGPA ==4.0);
if ($studentTwoName == 4.0); {
echo 'made honor roll';
} elseif ($studentOneGPA = "") {
echo 'has a GPA of 3.8';
}

?>

1 Answer

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

Hi there, Fortunate Chiratidzo Mandizvidza! The cause of your current error is an extraneous semicolon after the first if conditional.

You typed:

if ($studentTwoName == 4.0); {

But you meant to type:

if ($studentTwoName == 4.0) {

Note the removal of the semicolon between the closed parenthesis and the open curly brace. There will still be more errors, but you will get hints on the next one. Removing the semicolon will fix this particular error.

Hope this helps! :sparkles:

thanks it has removed that error but now failing to understand this error i am getting; "Bummer: You need to check that $studentOneGPA is equal to 4.0" <?php $studentOneName = 'Dave'; $studentOneGPA = 3.8;

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

//Place your code below this comment var_dump($studentOneGPA ==4.0); var_dump($studentTwoGPA ==4.0); if ($studentTwoName == 4.0) { echo 'made honor roll'; } elseif ($studentOneGPA = "") { echo 'has a GPA of 3.8'; }

?>

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

Fortunate Chiratidzo Mandizvidza Hi again! This is one of those times when the Bummer message is very helpful. It says "You need to check that $studentOneGPA is equal to 4.0".

Here's your line:

if ($studentTwoName == 4.0)

But you're not checking that $studentOneGPA is equal to 4.0, you're checking if $studentTwoName is equal to 4.0. Hpe this helps you get a bit further along in the troubleshooting process! :sparkles: