loop and switch use in c++
Hello,
I am trying to develop the curreny exchange program and
unbale to use loop and switch statment in following code.
Please help us how can use the loop and switch statement in
following code to convert one currency to another.
Regards
#include <iostream.h>
#include <conio.h>
main()
{
int e,r,d;
int a,eu;
char convert,convertinto;
cout<<"Wellcome to Exchange of Currency Rates Program C++ " <<"\n" <<"\n";
cout<<"Foreign Cuurency Exchange Rates are following" <<"\n";
cout<<"-------------------------------------------- "<<"\n";
cout<<"1 Euro = 112 Rupees." <<"\n";
cout<<"1 Dollar = 84 Rupees." <<"\n";
cout<<"1 Euro = 1.33 Dollars." <<"\n";
cout<<"1 Dollar = 0.75 Euro " <<"\n";
cout<<"-------------------------------------------- "<<"\n";
cout<<"Please select currencies that you want to exchange." <<"\n";
cout<<"Description :" <<"\n";
cout<<"---------------------- "<<"\n";
cout<<"Enter 'R' for Pakistani Rupees." <<"\n";
cout<<"Enter 'E' for Euro." <<"\n";
cout<<"Enter 'D' for Dollar." <<"\n" <<"\n";
cout<<"Please select the correny that you want to convert.";
cin>>convert;
cout<<"Please select the correny that you want to convert into .";
cin>>convertinto;
cout<<"Please enter the amount in Euro :";
cin >>eu;
a = eu * 112;
cout<<eu<<" Euro = "<<a<<" "<<"Rupees"<<"\n"<<"\n";
cout<<"Press any key to Exit....";
getch();
}
|