Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- int main()
- {
- double eur_rur = 79.06;
- double usd_rur = 71.86;
- double gbp_rur = 102.30;
- double currency = 0;
- char unit = ' ';
- std::cout << "Please enter the number of roubles you have: " << std::endl;
- std::cin >> currency;
- std::cout << "Please enter the currency you want to convert you money ('e' - Euro, 'd' - Dollar, 'g' - Great Britan Pounds): " << std::endl;
- std::cin >> unit;
- if (unit == 'e')
- {
- std::cout << currency << " roubles = " << currency / eur_rur << " Euro." << std::endl;
- }
- else if (unit == 'd')
- {
- std::cout << currency << " roubles = " << currency / usd_rur << " Dollars." << std::endl;
- }
- else if (unit == 'g')
- {
- std::cout << currency << " roubles = " << currency / gbp_rur << " Great Britan Pounds." << std::endl;
- }
- else
- {
- std::cout << "Sorry, i do not understand what you input." << std::endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement