Design and create a class named Stats that has an array of 12 doubles as one of its member variables. The values in the array should be set by making 12 calls to a public member function named setValue that accepts two arguments, an integer indicating which value is being provided (the first number, the second number….etc) and a double holding the actual data value.
what does that mean?
I made this
#include <iostream>
#include <iomanip>
using namespace std;
class Stats
{
private:
double values[12];
public
Stats();
};
void Stats::Stats()
{
int num;
for(int i = 0; i <=12; i++)
{
//SOME INPUT VALIDATION HERE
cout << "Input value # "<< i << endl;
cin >> num;
values[i] = num
}
}
but is that what it means?