Created
April 26, 2022 22:31
-
-
Save abdorll/c68fd0bed25ff0cc13cdbdfa43685b18 to your computer and use it in GitHub Desktop.
Title: Side Hustle capstone project, Department: Mobile App Development, Group nō: 73, Group Leader: Opadeji Abdullah Ololade (SH-IT-0005487)
This file contains hidden or 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
void main () { | |
scoreAndSubjectResult(60, "Physics"); | |
scoreAndSubjectResult(80, "Chemistry"); | |
} | |
scoreAndSubjectResult(score, subject){ | |
SubjectAndScore subjectAndScore = SubjectAndScore(); | |
subjectAndScore.subject = subject; | |
subjectAndScore.score = score; | |
scoreCheck(score, subject); | |
} | |
scoreCheck(score, subject){ | |
if ((score >= 80) & (score <= 100)) { | |
print ("Your grade for $subject is A"); | |
} else if ((score >= 60) & (score <= 79)) { | |
print ("Your grade for $subject is B"); | |
} else if ((score >= 50) & (score <= 59)) { | |
print ("Your grade for $subject is C"); | |
} else if ((score >= 40) & (score <= 49)) { | |
print ("Your grade for $subject is D"); | |
} else if (score < 40) { | |
print ("Your grade for $subject is F"); | |
} else { | |
print (" Your grade for $subject is not found"); | |
} | |
} | |
class SubjectAndScore{ | |
String? subject; | |
num? score; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment