Object Methods
Lesson 31Author : 🦒
Last Updated : November, 2017
Code
class Student{
public $name;
public $gpa;
function __construct($name, $gpa){
$this->name = $name;
$this->gpa = $gpa;
}
function hasHonors(){
if($this->gpa >= 3.5){
return true;
}
return false;
}
};