Last active
June 7, 2021 13:54
-
-
Save Bharathh-Raj/476ba7921df91aa405bede50bca38e64 to your computer and use it in GitHub Desktop.
S.O.L.I.D - Single Responsibility Principle - 1
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
class Student{ | |
String id; | |
String name; | |
int english; | |
int mathematics; | |
int science; | |
String displayAsString(){ | |
return "Student ID:$id\nStudent Name:$name\nEnglish:$english\nMathematics:$mathematics\nScience:$science"; | |
} | |
void save(){ | |
//Inserts Student with all the properties to the local database. | |
} | |
void delete(){ | |
//Delete a student from the local database. | |
} | |
double calculateScore(){ | |
//Calculates score based on the marks. | |
} | |
bool didStudentPass(){ | |
//Based on the marks the student got, this is determined. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment