So I basically have to create a program that:

- allows users to enter 10 numbers

- store those number in an array

- data type to store numbers in array should be float or double

- create and use a function to calculate the average of the numbers in the array

- output the average

I keep getting error lnk 2019 and lnk 1120; both which are "unresolved externals"?

This is what I have so far:

#include <iostream> using namespace std; int main() { double Sum; //declares sum as double float double Average; //declares average as double float double PositiveNumber[10]; //array of 10 positive numbers const int i; // Sum = 0; Average = 0; for (i = 0; i < 10; i++) { cout << "Please enter ten positive numbers : " << (i + 1) <<end1; cin >> PositiveNumber[i]; if PositiveNumber[i] < 0 { cout << "Please make sure your numbers are positive " << end1; } while PositiveNumber [i] > 0; { Sum = Sum + PositiveNumber[i] } } Average = Sum/10; // Computes average by dividing sum of positive numbers by 10 cout << "The average of your numbers is " << Average << end1; // display the result return 0; // terminate with success }

This post has been edited by **no2pencil**: 18 December 2010 - 02:21 PM

Reason for edit:: Added Code Tags