struntz
Jan 16th, 2001, 06:33 PM
Hello everyone!
i have been having troubles trying to compile this program, i ahve been getting around 10-12 errors i'll post the errors after the code.
#include <iostream.h>
float Convert(float);
int main()
{
float TempFer;
float TempCel;
cout <<"Enter a Ferienthite Degree.";
cout << "\n Ferienthite.\n";
cin >> TempFer;
TempCel = Convert(TempFer);
cout << "here is the temperature in Celcius: ";
cout << TempCel << endl;
return 0;
}
float Convert(TempFer)
{
float TempCel;
TempCel = ((TempFer - 32)*5) / 9;
return TempCel;
}
Errors:
c:\my documents\c++programs\day5\converttemp.cpp:19: `TempFer' was not declared in this scope
c:\my documents\c++programs\day5\converttemp.cpp:20: `float Convert' redeclared as different kind of symbol
c:\my documents\c++programs\day5\converttemp.cpp:3: previous declaration of `float Convert(float)'
c:\my documents\c++programs\day5\converttemp.cpp:20: syntax error before `{'
c:\my documents\c++programs\day5\converttemp.cpp:22: ANSI C++ forbids declaration `TempCel' with no type
c:\my documents\c++programs\day5\converttemp.cpp:22: `TempFer' was not declared in this scope
c:\my documents\c++programs\day5\converttemp.cpp:23: parse error before `return'
Can someone tell me what i'm doing wrong?
thanks for listening :D
Note: Compiler i'm using is DevC++ its a GUI
i have been having troubles trying to compile this program, i ahve been getting around 10-12 errors i'll post the errors after the code.
#include <iostream.h>
float Convert(float);
int main()
{
float TempFer;
float TempCel;
cout <<"Enter a Ferienthite Degree.";
cout << "\n Ferienthite.\n";
cin >> TempFer;
TempCel = Convert(TempFer);
cout << "here is the temperature in Celcius: ";
cout << TempCel << endl;
return 0;
}
float Convert(TempFer)
{
float TempCel;
TempCel = ((TempFer - 32)*5) / 9;
return TempCel;
}
Errors:
c:\my documents\c++programs\day5\converttemp.cpp:19: `TempFer' was not declared in this scope
c:\my documents\c++programs\day5\converttemp.cpp:20: `float Convert' redeclared as different kind of symbol
c:\my documents\c++programs\day5\converttemp.cpp:3: previous declaration of `float Convert(float)'
c:\my documents\c++programs\day5\converttemp.cpp:20: syntax error before `{'
c:\my documents\c++programs\day5\converttemp.cpp:22: ANSI C++ forbids declaration `TempCel' with no type
c:\my documents\c++programs\day5\converttemp.cpp:22: `TempFer' was not declared in this scope
c:\my documents\c++programs\day5\converttemp.cpp:23: parse error before `return'
Can someone tell me what i'm doing wrong?
thanks for listening :D
Note: Compiler i'm using is DevC++ its a GUI