class average
{
public:
void setFunctions (int n[100], int t);
int getNum () const;
int Sum () const;
int Ave () const;
int getTotal () const;
void print () const;
average ();
average (int n[100], int t);
int sum;
int ave;
private:
int num [100];
int total;
const int ARRAY_SIZE = 100, i;
int n[ARRAY_SIZE] = {i};
void average::setFunctions (int n[100], int t)
{
if (n[100] >= 0)
n[100] = num[ARRAY_SIZE];
else
num[ARRAY_SIZE] = 0;
if (t >=0)
t= total;
else
total = 0;
}
int average::getNum () const
{
return num[ARRAY_SIZE];
}
int average::Sum () const
{
for (n[i] = 0; n[i]< 100; n[i]++)
{
int sum = 0;
sum = sum + n[i];
return sum;
}
}
and the main.cpp file
#include <iostream>
#include "average.h"
using namespace std;
int main()
{
average myAverage1;
int t;
int n[100];
cout << "how many numbers to you want to enter?" << endl;
cin >> t;
for (int i = 0;i<t;i++)
{
cout << "enter a number" << endl;
cin >> n[i];
}
myAverage1.getNum();
myAverage1.getTotal();
cout << "The sum of your numbers are is";
myAverage1.Sum();