It is not converting the convertToYen, convertToEuros, and convertToPesos properly. I'm pretty sure it because it's taking it's answer from convertMulti but I can't figure out how to stop it. Please help!!
#include <iostream>
#include <iomanip>
using namespace std;
cout << "Please input the amount of American Dollars you want converted "
<< endl;
cout << "to euros and pesos" << endl;
cin >> dollars;
convertMulti(dollars, euros, pesos);
cout << dollars << " is converted to " << euros << " euros and " << pesos << " pesos." << endl;
cout << "Please input the amount of American Dollars you want converted\n";
cout << "to euros, pesos and yen" << endl;
cin >> dollars;
convertMulti(dollars, euros, pesos, yen);
cout << dollars << " is converted to " << euros << " euros and " << pesos << " pesos and " << yen << " yen." << endl;
cout << "Please input the amount of American Dollars you want converted\n";
cout << "to yen" << endl;
cin >> dollars;
convertToYen(yen);
cout << dollars << " is converted to " << yen << " yen." << endl;
cout << "Please input the amount of American Dollars you want converted\n";
cout << " to euros" << endl;
cin >> dollars;
convertToEuros(euros);
cout << dollars << " is converted to " << euros << " euros." << endl;
cout << "Please input the amount of American Dollars you want converted\n";
cout << " to pesos " << endl;
cin >> dollars;
convertToPesos(dollars);
cout << dollars << " is converted to " << pesos << " pesos." << endl;
system("pause");
return 0;
}
// All of the functions are stubs that just serve to test the functions
// Replace with code that will cause the functions to execute properly
// **************************************************************************
// convertMulti
//
// task: This function takes a dollar value and converts it to euros
// and pesos
// data in: dollars
// data out: euros and pesos
//
// *************************************************************************
void convertMulti(float dollars, float& euros, float& pesos)
{
euros = dollars * 1.06;
pesos = dollars * 9.73;
}
// ************************************************************************
// convertMulti
//
// task: This function takes a dollar value and converts it to euros
// pesos and yen
// data in: dollars
// data out: euros pesos yen
//
// ***********************************************************************
void convertMulti(float dollars, float& euros, float& pesos, float& yen)
{
euros = dollars * 1.06;
pesos = dollars * 9.73;
yen = dollars * 124.35;
}
// convertToYen
//
// task: This function takes a dollar value and converts it to yen
// data in: dollars
// data returned: yen
//
// ***************************************************************************
float convertToYen(float dollars)
{
cout << "The function convertToYen was called with " << dollars << " dollars"
<< endl << endl;
return 0;
}
// ****************************************************************************
// convertToEuros
//
// task: This function takes a dollar value and converts it to euros
// data in: dollars
// data returned: euros
//
// ***************************************************************************
float convertToEuros(float dollars)
{
cout << "The function convertToEuros was called with " << dollars
<< " dollars" << endl << endl;
return 0;
}
// *****************************************************************************
// convertToPesos
//
// task: This function takes a dollar value and converts it to pesos
// data in: dollars
// data returned: pesos
//
// ****************************************************************************
float convertToPesos(float dollars)
{
cout << "The function convertToPesos was called with " << dollars
<< " dollars" << endl;
return 0;
}
I expect them to covert the amount I enter to whatever they need to be. Instead it's just taking what I get from convertMulti and sticking it in the individual functions.
So
Float convertToPesis(float dollars)
{
Dollars = dollars * 9.73;
Cout << "The function convertToPesis was called with " << dollars << " dollars" << endl;
I changed them all to the example you showed me. But the problem is, even when I run the program, it is till outputting what convertMulti gets rather then what the convertToYen is getting.