Calculate percentage of student

We have to calculate the percentage of marks obtained in three subjects (each out of 100) by student A and in four subjects (each out of 100) by student B. Create an abstract class 'Marks' with an abstract method 'get Percentage'. It is inherited by two other classes 'A' and 'B' each having a method with the same name which returns the percentage of the students. The constructor of student A takes the marks in three subjects as its parameters and the marks in four subjects as its parameters for student B. In main class create an object for each of the two classes and print the percentage of marks for both the students.



Read more here: https://stackoverflow.com/questions/65704788/calculate-percentage-of-student

Content Attribution

This content was originally published by Ch Muhammad Huzaifa at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: