Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- const double yen = .0093;
- const double euro = 1.23;
- const double pound = 1.39;
- int amount = 1;
- char currency = ' ';
- cout<< "Please enter currency followed by yen or euros or pounds:\n";
- cin >> amount >> currency;
- if (currency == 'yen')
- cout << amount*0.0093;
- else if (currency == 'euro')
- cout << amount*1.23;
- else if (currency == 'pounds')
- cout << amount*1.39;
- else
- cout << "Sorry, I don't know a unit called '" << currency << "'\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement