Currency Conversion in C++
Page 1 of 1
Currency Conversion in C++
Question: Currency traders wants a program that converts american dollars to British pounds, Philippine Pesos and Japanese yen and then Display the result. Use the the following conversion rates for 1 american dollar: 0.571505 British pounds, 40.7956 Philippine pesos and 112.212 Japanese yen. save it as "arithmetic3.cpp".
Output:
Enter the amount in american dollars: ___________
"____________ American Dollars is equal to _____________ pounds."
"____________ American Dollars is equal to _____________ pesos."
"____________ American Dollars is equal to _____________ yen"
Answer codes:
Output:
Enter the amount in american dollars: ___________
"____________ American Dollars is equal to _____________ pounds."
"____________ American Dollars is equal to _____________ pesos."
"____________ American Dollars is equal to _____________ yen"
Answer codes:
- Code:
# include <iostream>
using namespace std;
int main()
{
double a,b=0.571505,c=40.7956,d=112.212;
cout<<"Enter the amount in american dollars: ";
cin>>a;
cout<<endl<<endl;
cout<<a<<" American Dollar(s) is equal to "<<a*b<<" pounds."<<endl;
cout<<a<<" American Dollar(s) is equal to "<<a*c<<" pesos."<<endl;
cout<<a<<" American Dollar(s) is equal to "<<a*d<<" yen."<<endl;
//system("pause");
return 0;
}
princeterror- Universal Moderator
- Posts : 272
Credits : 11465
Fame : 81
Join date : 2012-06-07
Age : 33
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum