My program keeps failing....Help!!!

Could someone run my program and tell me what is wrong please? It keeps failing and I don't know what to do. Thanks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
  #include <iostream>
using namespace std;
#include <iomanip>

int getScore (int, int, double total);
double calcAverage( int, int);
int findLowest(int scoreArray [5]);

int main()

{
	int scoreArray[5];
	int testScore = 0;
	double avg = 0.0;
	int lowest = 0;
	int i = 0;
	double total = 0.0;

	for (int i = 1; i <=5; i++)
	{
		testScore = getScore(testScore , i , total);
		scoreArray[i-1] = testScore;
	}
	
	int getScore (int testScore, int i, double total);

	lowest = findLowest(scoreArray);
	avg = calcAverage(lowest, total);

	cout << "\nThe lowest score dropped was: "<< lowest << endl;
	cout << " The average is " <<setprecision(2) << fixed << avg;
	
	
	{
		cout <<"Please enter your score for exam" << i;
		cin >> testScore;
	}
	
	{
	while (testScore < 0 || testScore > 100)
	
		cout <<"Please enter a valid score. Try Again."<< endl;
		cin >> testScore;
	
	}
	
	total += testScore;
	
	
	return testScore;
	
	
	
	return 0;
}
double calcAverage ( int lowest, int total)
{
	int sumOfFour = 0;
	float avg = 0.0f;

	sumOfFour = total - lowest;
	avg = sumOfFour / 4.0f;
	return avg;
}
	
	
	
	int findLowest( int scoreArray[5])
	{
		int smallest = scoreArray [0];
		for (int i = 1; i < 5; i++)
		{
			if (scoreArray[i] < smallest)
				smallest = scoreArray[i];
		}
		return smallest;
	}
int getScore (int testScore, int i, double total);

Why is this inside your main? It doesnt do anything. You need to move this below main and create the function below main, and do all of the stuff there, just like you've done with your two other functions.
Topic archived. No new replies allowed.