Advertisement
Guest User

Untitled

a guest
Feb 21st, 2018
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. {
  2. const double yen = .0093;
  3. const double euro = 1.23;
  4. const double pound = 1.39;
  5. int amount = 1;
  6. char currency = ' ';
  7. cout<< "Please enter currency followed by yen or euros or pounds:\n";
  8. cin >> amount >> currency;
  9.  
  10. if (currency == 'yen')
  11. cout << amount*0.0093;
  12. else if (currency == 'euro')
  13. cout << amount*1.23;
  14. else if (currency == 'pounds')
  15. cout << amount*1.39;
  16. else
  17. cout << "Sorry, I don't know a unit called '" << currency << "'\n";
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement