Write the program to convert currency
User enters amount in Rupees and convert it into Euro. minimum amount to covert in euro is 113rs.
User enters the amount enter in Euro and convert it into Yen. Restrict the user to enter minimum 5 euro.
User enters the amount in Dollars and convert it into Euro. Restrict the user to enter at least 15 dollars. For less than 15 Dollars display error message “Please enter amount greater than 15 Dollars”.
code :
#include <iostream>
using namespace std;
int main()
{
char choice;
cout << "Press 1 to convert Rupees into Euro " << endl;
cout << "Press 2 to convert Euro into Yen " << endl;
cout << "Press 3 to convert Dollars into Euro " << endl;
cout<<"choose one option from above mentioned options to convert currency:";
cin >> choice;
switch(choice) {
case'1':{
float RS, Euro;
cout<<"Enter minimum amount in 113RS:";
cin >>RS;
if(RS>=113){
cout <<"your amount is="<< RS*0.0065<<"Euro"<<endl<<endl;
}//end of if
break;
}
case'2':{
float Euro,Yen;
cout<<"Enter minimum amount in 5Euro:";
cin >>Euro;
if(Euro>=5){
cout <<"your amount is="<< Euro*128.86<<"Yen"<<endl<<endl;
}//end of if
break;
}
case'3':{
float Dollar,Euro;
cout<<"Enter minimum amount in 15Dollars:";
cin >>Dollar;
if(Dollar>=15){
cout <<"your amount is="<< Dollar*0.88<<"Euro"<<endl<<endl;
}//end of if
else if (Dollar<15){
cout<<"Please enter amount greater than 15 Dollars";
}//end of else
break;
}
}//end of switch
return 0;
system("pause");
}
outputs:
Press 1 to convert Rupees into Euro
Press 2 to convert Euro into Yen
Press 3 to convert Dollars into Euro
choose one option from above mentioned options to convert currency:1
Enter minimum amount in 113RS:200
your amount is=1.3Euro
Press 1 to convert Rupees into Euro
Press 2 to convert Euro into Yen
Press 3 to convert Dollars into Euro
choose one option from above mentioned options to convert currency:2
Enter minimum amount in 5Euro:10
your amount is=1288.6Yen
Press 1 to convert Rupees into Euro
Press 2 to convert Euro into Yen
Press 3 to convert Dollars into Euro
choose one option from above mentioned options to convert currency:3
Enter minimum amount in 15Dollars:20
your amount is=17.6Euro
0 Comments