right now you have no idea of scope, using parameters or calling functions
start here
http://cplusplus.com/doc/tutorial/functions/
look at the examples and compare against your code
> Instead of giving me the output of a math problem (Fahrenheit - 32 ) / 1.8,
> it's giving me characters like 0000B71442.
c++ is not math, code is not equations
the code is read from top to bottom, each line will be executed sequentially
1 2 3 4 5
|
void conversionTemp()
{
float Fahrenheit = 0;
float conversionTemp = (Fahrenheit - 32) / 1.8;
}
| |
`Fahrenheit' has the value 0, so `conversionTemp' will have -17.778
however, the function ends and you do nothing with those variables
your function does nothing
1 2 3 4 5 6
|
int main()
{
float Fahrenheit = 0;
cout << "Please enter temperature to be converted: " << endl;
cin >> Fahrenheit;
cout << "The temperature is: " << conversionTemp << endl;
| |
the `Fahrenheit' variable defined in `main()' is a different variable from the `Fahrenheit' defined in `conversionTemp()'
they have no relationship, they just happen to share the same name
¿so how to pass that value to `conversionTemp()'? use parameters
right now your function have no meanings of communication, it's completely useless
what's more, you never call the `conversionTemp()' function, to call a function you need to use parenthesis
these errors and more would have been kindly identified by your compiler if you bother to activate the warnings and actually read them.
>
cin >> speed, distance;
¿did you use commas (,) with cout?
also, `eta' is a terrible function name, please, DEA