In this HackerRank Classes and Objects problem in c++ we need to create a class named Student that has an instance variable named scores to hold a student's 5 exam scores. a void input() function that reads 5 integers and saves them to scores. an int calculateTotalScore() function that returns the sum of the student's scores.

HackerRank Classes and Objects in C++ problem solution

Hackerrank Classes and Objects in C++ problem solution

class Student 
    {
    public :
    int a,b,c,d,e;
    void Input()
        {
       scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
    }
    int CalculateTotalScore()
        {
        return a+b+c+d+e;
    }
};