#include <iostream>

int howManyTimes() //How many numbers to add together in total
    {
        int amount;
        std::cout << "How many numbers do you have to average out: ";
        std::cin >> amount;
        return(amount);
    }

double calcAverage(int times)
    {
        double sum; // The numbers sum
        int num;

          for( int i = 1; i < (times + 1); i++)
            {
              std::cout << "What's number " << i << ": ";
              std::cin >> num;
              sum = sum + num; // Isn't there a better way to do that?
            }
        return((sum / times));
    }
int main()
{
    std::cout << calcAverage(howManyTimes());
    return 0;
}
