Here are a few examples to show you how functions work. Please study them very carefully.
int twice(int x) { // You CANNOT use 'y' or 'z' here, because they do not belong to this // function, but instead to the main function. return x * 2;}int main() { int y, z; y = 10; z = twice(y); // the variable 'y' gets copied into the function parameter 'x', // twice() does its work, and the returned value is assigned to 'z'. // It does not matter that the name 'y' in main() does not match the function // parameter's name. There is no correspondence there. You can pass anything // you like (as long as the type is correct). // At this point, y == 10 and z == 20. y = twice(15); // Now y == 30. Can you see why? // Bonus question. Why didn't I call the function "double"? :)}
You need to communicate to a function all the information that is needed to perform its task. In this case, the exchange rate is part of that; and the work done by the functions is so simple that nothing is really gained by using them (except for practice, of course).
Also, did you not notice the heading "For Beginners" at the top of the forum list? We have a whole separate forum for new programmers so they don't interrupt the discussion of more serious difficulties (and can be treated more nicely while we're at it).