Program due in 1 hour but i have 1 error help!

I have one error for this code and I cannot find the solution, help would be so much appreciated. The error code is: error LNK2019: unresolved external symbol "float __cdecl calctotaltime(int,float)" (?calctotaltime@@YAMHM@Z) referenced in function _main

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
  //Library files 

#include <iostream>
using namespace std;

//Function prototypes

int collectdvdmins ( int dvdmins );

float calctotaltime ( int dvdmins, float totaltime ); 

void displayoutput ( int dvdmins, float totaltime );


int main ( )

{

int dvdmins = 0;
float totaltime = 0; 

dvdmins = collectdvdmins ( dvdmins );
totaltime = calctotaltime ( dvdmins, totaltime );
displayoutput( dvdmins, totaltime );

system ("PAUSE");

return 0;

}

//Function Defintions 

int collectdvdmins ( int dvdmins )
{
cout << "Enter the total DVD runtime in minutes./n";
cin >> dvdmins;
return dvdmins;
}

int calctotaltime ( float totaltime, int dvdmins )
{
totaltime = dvdmins/60;
return totaltime;
}

void displayoutput ( int dvdmins, float totaltime )
{
cout<< "DVD runtime\n\n";
}

@dakotahelp

I see you have the function definition not matching the actual function.

float calctotaltime ( int dvdmins, float totaltime );
Your function definition

int calctotaltime ( float totaltime, int dvdmins )
Your function

You defined it as a float, but have it as an int.
Also, the variables sent, are in opposite locations in the call.

Your function definition doesn't match your prototype for the calctotaltime function.
First, the return type doesn't match. Then, look at the parameters. When you define it on line 10 and call it on line 23, the int parameter comes first, followed by the float parameter. When you define the function on line 41, you have the float parameter first instead of the int parameter. Fixing those will at least get you compiling.
@booradley60
I'm sorry but what do you mean about line 10 and 23 when you say the int parameter comes first? I already have it fist it looks like.
Yes, that is what was said. As boordaley60 said, the problem is the definition on line 41 does not have it first.
@zhuge I fixed that and I'm still having the error
Topic archived. No new replies allowed.