PHP PHP Basics Daily Exercise Program Conditionals

Ashish Jain
Ashish Jain
6,319 Points

where am I wrong?

Please have a look at the code and please let me know where I am wrong. Thanks.

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 .' has made the Honor Roll';
}
else {
  echo $studentOneName ." has a GPA of $studentOneGPA";
  }

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

1 Answer

Steven Parker
Steven Parker
177,579 Points

The instructions say that when the GPA is 4.0, then the output should be "NAME made the Honor Roll".

But this code outputs "NAME has made the Honor Roll`" instead. The extra word "has" is throwing it off.