#include <iostream>
usingnamespace std;
double rate;
int curr_selection;
double input;
void currencycheck()
{
cout<<"Please enter the currency you would like to convert to\n";
cout<<"(1)Euros\n";
cout<<"(2)Pounds\n";
cin>>curr_selection;
if (curr_selection!=1&&curr_selection!=2)
{
cout<<"Invalid selection\n";
cout<<"Please enter your selection again\n";
cin>>curr_selection;
}
}
void ratecheck()
{
cout<<"Please enter the exchange rate you would like to use\n";
cout<<"Enter (-1) for default rate\n";
cin>>rate;
if (rate==-1)
{
rate=1.144;
}
}
double amount(double)
{
cout<<"Please enter the amount you would like to convert\n";
cin>>input;
return input;
}
double conversion(double)
{
double result;
result=input*rate;
if (curr_selection==1)
{
cout<<1/result;
}
else
{
cout<<result;
}
return result;
}
int main()
{
currencycheck;
ratecheck;
amount;
conversion;
system("pause");
return 0;
}