Hi everyone! i am trying to create a working currency exchange calculator for my Assignment, all was going well until completion of my program ran into multiple semantic errors however i have no idea where they are or how to fix them.
any help would be greatly appreciated.
my code at the moment:
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
system("cls");
string currency, currency2, currency3; // currency is DOLLAR currency2 is EURO and currency 3 is POUNDS
char billgates;
int loop = 1;
string choice;
int value;
do{
cout << "please enter either Euro, Pounds or Dollar";
cin >> currency; //user enters either Euro Pounds or Dollar
cout << "please enter either Euro, Pounds or Dollar";
cin >> currency2; //user enters second value
cout << "Please enter the value of the currency you want to exchange";
cin >> value;
if (currency == "Dollar" && currency2 == "Euro")
{
cout << value * 1.13; // the difference between one dollar and one euro is 1.13 on the 13/3/18
cout << "Would you like to perform another conversion ?" << endl;
cin >> choice;
if (choice == "yes") {
}
else if (choice == "no") {
}
}
if (currency == "Dollar" && currency3 == "Pounds") //find out conversion rate //someone help me please i cannot C++ to save my life
{
cout << value * 0.72; // the difference between one dollar and one pound is 0.72 on the 13/3/18
cout << "Would you like to perform another conversion ?" << endl;
cin >> choice;
if (choice == "yes") {
}
else if (choice == "no") {
}
}
else if (currency2 == "Euro" && currency == "Dollar")
{
cout << value * 1.23; //the difference between one Euro and Dollar is 1.23 on the 13/3/18
cout << "Would you like to perform another conversion ?" << endl;
cin >> choice;
if (choice == "yes") {
}
else if (choice == "no") {
}
}
else if (currency2 == "Euro" && currency3 == "Pounds")
{
cout << value * 0.89; // on the 13/03/18 the difference between one euro and one pound is 0.89
cout << "Would you like to perform another conversion ?" << endl;
cin >> choice;
if (choice == "yes") {
}
else if (choice == "no") {
}
}
else if (currency3 == "Pounds" && currency == "Dollar")
{
cout << value * 1.39; // on the 13/3/18 the value of one pound to the dollar was 1.39
cout << "Would you like to perform another conversion ?" << endl;
cin >> choice;
if (choice == "yes") {
}
else if (choice == "no") {
}
}
else if (currency3 == "Pounds" && currency2 == "Euro")
{
cout << value * 1.13; // on the 13/3/18 the value of one pound to one euro is 1.13
cout << "Would you like to perform another conversion ?" << endl;
cin >> choice;
if (choice == "yes") {
#include <iostream>
#include <string>
#include <cstdlib>
usingnamespace std;
int
main()
{
system("cls");
string currency, currency2, currency3; // currency is DOLLAR currency2 is EURO and currency 3 is POUNDS
// char billgates;
int loop = 1;
string choice;
int value;
do {
cout << "please enter either Euro, Pounds or Dollar";
cin >> currency; //user enters either Euro Pounds or Dollar
cout << "please enter either Euro, Pounds or Dollar";
cin >> currency2; //user enters second value
cout << "Please enter the value of the currency you want to exchange";
cin >> value;
if (currency == "Dollar" && currency2 == "Euro") {
cout << value * 1.13; // the difference between one dollar and one euro is 1.13 on the 13/3/18
}
if (currency == "Dollar" && currency3 == "Pounds") //find out conversion rate //someone help me please i cannot C++ to save my life
{
cout << value * 0.72; // the difference between one dollar and one pound is 0.72 on the 13/3/18
} elseif (currency2 == "Euro" && currency == "Dollar") {
cout << value * 1.23; //the difference between one Euro and Dollar is 1.23 on the 13/3/18
} elseif (currency2 == "Euro" && currency3 == "Pounds") {
cout << value * 0.89; // on the 13/03/18 the difference between one euro and one pound is 0.89
} elseif (currency3 == "Pounds" && currency == "Dollar") {
cout << value * 1.39; // on the 13/3/18 the value of one pound to the dollar was 1.39
}
elseif (currency3 == "Pounds" && currency2 == "Euro") {
cout << value * 1.13; // on the 13/3/18 the value of one pound to one euro is 1.13
} else {
cout << "Can't convert from " << currency << " to " << currency2 << '\n';
}
cout << "Would you like to perform another conversion ?" << endl;
cin >> choice;
} while (choice == "yes");
return 0;
}