Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- double pln,usd,eur,kzt;
- char answer;
- do
- {
- cout <<"Type 1 to convert PLN to EURO\n""2 to convert EURO to PLN\n""3 to convert PLN to USD\n""4 to convert USD to PLN\n""5 to convert PLN to KZT\n""6 to convert KZT to PLN\n";
- char choice;
- cin>>choice;
- cout <<"Your choice is: "<<choice<<endl;
- switch (choice)
- {
- case '1':
- cout <<"Enter the amount in PLN: ";
- cin>>pln;
- eur=pln/4.4025;
- cout <<pln<<" PLN = "<<eur<< " EURO";
- break;
- case '2':
- cout <<"Enter the amount in EUR: ";
- cin>>eur;
- pln=eur*4.4025;
- cout <<eur<<" EUR = "<<pln<< "PLN";
- break;
- case '3':
- cout <<"Enter the amount in PLN: ";
- cin>>pln;
- usd=pln/3.9976;
- cout <<pln<<" PLN = "<<usd<< " USD";
- break;
- case '4':
- cout <<"Enter the amount in USD: ";
- cin>>usd;
- pln=usd*3.9976;
- cout<<usd<<" USD = "<<pln<< "PLN";
- break;
- case '5':
- cout <<"Enter the amount in PLN: ";
- cin>>pln;
- kzt=pln*100.062;
- cout<<pln<<" PLN = "<<kzt<< "KZT";
- break;
- case '6':
- cout <<"Enter the amount in KZT: ";
- cin>>kzt;
- pln=kzt/100;
- cout<<kzt<<" KZT = "<<pln<< "PLN";
- break;
- default:
- cout <<"Wrong choice"<<endl;
- }
- cout <<"\nDo you want to continue?(y/n)";
- cin>>answer;
- cin.ignore(100,'\n');
- }
- while (answer=='Y' || answer=='y');
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement