Search Program

This program is suppose to display the name, age, talent, and average score of the performer I keep getting compiling errors. I am new to this. Any help would be greatly appreciated.


#include<iostream>
#include<string>
using namespace std;

//////////////////////////////////////
// Prototypes
//////////////////////////////////////
void getPerformer(string&, int&, string&);
void getJudgesScores(double&, double&, double&, double&, double&);
double calculateAverage(double&, double&, double&, double&, double&);
void displayResults(string&, int&, string&, double&);


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
int main()
{
	//variables
	int age = 0;
	double score1 = 0;
	double score2 = 0;
	double score3 = 0;
	double score4 = 0;
	double score5 = 0;
	double averageScore = 0;
	



	string name;
	string talent;

	getPerformer(name, age, talent);


	displayResults(name, age, talent, averageScore);

	return 0;
}

//////////////////////////////////////
// Function Definitions
//////////////////////////////////////
void getPerformer(string& tempName, int& tempAge, string& tempTalent)
{
	cout << "May I have your name please?" << endl;
	cin >> tempName;
	cout << "May I have your age please?" << endl;
	cin >> tempAge;
	cout << "What is your talent?" << endl;
	cin >> tempTalent;
}

void getJudgesScore(double tempscore1, double tempscore2, double tempscore3, double tempscore4, double tempscore5)
{	
	cout << "Score 1" << endl;
	cin >> tempscore1;
	cout << "Score 2" << endl;
	cin >> tempscore2;
	cout << "Score 3" << endl;
	cin >> tempscore3;
	cout << "Score 4" << endl;
	cin >> tempscore4;
	cout << "Score 5" << endl;
	cin >> tempscore5;
}



double calculateAverage(double tempscore1, double tempscore2, double tempscore3, double tempscore4, double tempscore5)
{
	return ( tempscore1 + tempscore2 + tempscore3 + tempscore4 + tempscore5 / 5);
}

void tempdisplayResults(string tempName, int tempAge, string tempTalent, double tempAverageScore)
{
	cout << tempName << tempAge <<  tempTalent << tempAverageScore << endl;
}
What are the errors?

1) you declare getJusdegScore with &s and defined it without them.
2) calculate average only divides the last tempscore by 5.
Last edited on
Topic archived. No new replies allowed.