Beginner need help with code!!

I have this assigntment and I think I got most of it right but I keep getting an error/warning when I try to compile the program

On line 24 I get the error and I don't know what to do this is what it keeps telling me

[Warning] passing `double' for converting 1 of `void displaySumAverage(int, double)'

I can't figure out how to fix it

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
#include<iostream>
#include<cstdlib>
#include<iomanip>

using namespace std;


int sumAverage(int times, int value, double sum, double average);
void displaySumAverage(int displaySum, double displayAverage);

int main()
{

int times, value, loop;
double sum, average;

while(loop != 0)

 {
loop = sumAverage(times, value, sum, average);
if (loop == 0)
break;

displaySumAverage(sum, average);


 }
    
system("pause");
return 0;
}


int sumAverage(int times, int value, double sum, double average)
{

    sum = 0;

cout << "How many numbers would you like to average? (Enter \"0\" to terminate) ";
cin >> times;

for(int count = 0; count < times; count++)

{

cout << " Enter a value to be added to the sum ";
cin  >> value;
sum  += value;
cout << endl ;

}


if (times!=0)
average = sum / times;

else
cout << "Program Terminated ";
return times;

}

void displaySumAverage(int displaySum, double displayAverage)

{

cout << " The sum of the entered values is: " << displaySum;
cout << " The average of the entered values is: " << setprecision(1) << showpoint << fixed << displayAverage <<endl;

return;

}
your function prototype for "displaySumAverage" has an int listed, change this to a double. Do the same in your function parameter list as well. (line 63)
Thank you!!

Okay I changed them to doubles and now my compiler doesn't display the error, but it won't run the program. I click compile and run in dev C++ and the program screen won't show up.
Topic archived. No new replies allowed.