SHARE
TWEET

Untitled

a guest Oct 16th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. float convert_leu_to_euro(int leu, float currency);
  6. float convert_euro_to_leu(int euro, float currency);
  7. float convert_leu_to_dollar(int euro, float currency);
  8. float convert_dollar_to_leu(int euro, float currency);
  9.  
  10. int main()
  11. {
  12.     int leu = 53;
  13.     float currency_euro = 4.4;
  14.     float currency_dollar = 4.3;
  15.  
  16.     cout << leu << " lei = " << convert_leu_to_euro(leu, currency_euro) << " euro" << endl;
  17.     int euro = 50;
  18.  
  19.     cout << euro << " euro = " << convert_euro_to_leu(euro, currency_euro) << " lei" <<
  20.         endl;
  21.  
  22.     cout << leu << " lei = " << convert_leu_to_dollar(leu, currency_dollar) << " dollar" << endl;
  23.     int dollar = 50;
  24.  
  25.     cout << euro << " dollar = " << convert_dollar_to_leu(dollar, currency_euro) << " lei" <<
  26.         endl;
  27.  
  28.     return 0;
  29. }
  30.  
  31. float convert_leu_to_euro(int leu, float currency)
  32. {
  33.     return leu / currency;
  34. }
  35.  
  36. float convert_euro_to_leu(int euro, float currency)
  37. {
  38.     return euro * currency;
  39. }
  40.  
  41. float convert_leu_to_dollar(int leu, float currency_dolar)
  42. {
  43.     return  leu / currency_dolar;;
  44. }
  45.  
  46. float convert_dollar_to_leu(int dollar, float currency)
  47. {
  48.     return dollar * currency;
  49. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top