Created
July 11, 2020 00:56
-
-
Save elminson/b3a3b0a5e07310d841543212018ccb50 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class courseGrade | |
{ | |
public function grade($currentGrade) | |
{ | |
if (!is_integer($currentGrade)) { | |
return "Invalid Data"; | |
} | |
if ($currentGrade < 60) { | |
return "Try again"; | |
} | |
if ($currentGrade > 100) { | |
return "Value No Valid"; | |
} | |
if ($currentGrade >= 70 and $currentGrade < 80) { | |
return 'Well'; | |
} | |
if ($currentGrade >= 80 and $currentGrade < 90) { | |
return "Very good"; | |
} | |
if ($currentGrade >= 90 and $currentGrade <= 100) { | |
return "Satisfying"; | |
} | |
if ($currentGrade >= 60 and $currentGrade < 70) { | |
return "Enough"; | |
} | |
} | |
} | |
$currentGrade = 65; | |
$newGrade = new courseGrade(); | |
echo $newGrade->grade($currentGrade); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment