#include <iostream>
class Result
{
public:
//this takes input from user
void takeTestInput()
{
for(int i = 0; i < sizeof(test)/sizeof(int); ++i)
{
std::cout<<"Input#"<<i+1<<": ";
std::cin >> test[i];//take the input and put into test[i]
}
}
void calculateAverage()
{
for(int i = 0; i < sizeof(test)/sizeof(int); ++i)
{
average+=test[i];
}
average = average/3;
}
void printAverage()
{
std::cout<<average;
}
private:
int test[3];
double average;
};
int main()
{
Result student1;
//take input for student1
student1.takeTestInput();
//calculate average for student1
student1.calculateAverage();
//check if the average calculated above is correct by printing out the average for student1
student1.printAverage();
return 0;
}