Really need help on this project

This wont compile because it says getDollarAmt must return a value.
Also getCurrencySelection must return a value. Please help.

#include <iostream>
using namespace std;

float getDollarAmt(float amount);
void displayCurrencies(char choice);
float getCurrencySelection(char & choice, float & currency);
bool isSelectionValid(float & amount, float & currency);
void calcExchangeAmt();
void displayResults();

int main()

{
float amount = 0;
char choice = 0;
float currency = 0;

getDollarAmt(amount);
displayCurrencies(choice);

return 0;
}

float getDollarAmt(float amount)
{
cout << "Please enter the total dollar to exchange: ";
cin >> amount;
}

void displayCurrencies(char choice)
{
switch (choice)
{
case 'A': "Russian Ruble";
break;
case 'B': "North Korean Won";
break;
case 'C': "Chinese Yuan";
break;
case 'D': "Cuban Peso";
break;
case 'E': "Ethiopian Birr";
break;
case 'F': "Thai Baht";
break;
case 'G': "Canadian Dollars";
break;
case 'H': "Tunisian Dinar";
break;
case 'I': "Egyptian Pound";
break;
}
}

float getCurrencySelection(char choice, float & currency)
{
cout << "Please enter your selection: ";
cin >> currency;
}
Signature for both of them says they will return 'float' so they need to return float.
Either change the return type in signature and implementation to void or return a float from both of them
As @codewalker said, any function that has a type, except void, must return that specific type of value (or an equivalent) at the end.

Notice how people always write int main( etc.. ) and have a return 0;.

It's not just because your professor told you it's the proper way to do things, and there is an EXIT_SUCCESS variable in <cstdlib> which gives the same exact value. So pay attention to your other functions as well; you'll need return values. Otherwise you'll keep getting the same errors over and over again.
Topic archived. No new replies allowed.