Object Methods
Lesson 31Author : GOUP
Last Updated : September, 2020
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;
}
};