c On a certain day the British pound was equivalent to 1487
c++
On a certain day the British pound was equivalent to $1.487 U.S., the French franc was $0.172, the German deutschemark was $0.584, and the Japanese yen was $0.00955. Write a program that allows the user to enter an amount in dollars, and then displays this value converted to these four other monetary units.
Solution
Solution.cpp
#include<iostream>//header file fr input output function
#define pound 1.487//pound equal to 1.487$
#define france 0.172//pound equal to 0.172$
#define deutschemark 0.584//pound equal to 0.584$
#define yen 0.00955//pound equal to 0.00955$
using namespace std;// it tells the compiler to link std namespace
int main()
{//main function
float amtdollar =0;
cout<<\"Enter an ammount in US Doller = \";
cin>>amtdollar;//key board inputting
cout<<\"Pound == \"<<amtdollar/pound<<endl;
cout<<\"France ==\"<<amtdollar/france<<endl;
cout<<\"deutschemark == \"<<amtdollar/deutschemark<<endl;
cout<<\"Yen == \"<<amtdollar/yen<<endl;
return 0;
}
output
Enter an ammount in US Doller = 100
Pound == 67.2495
France ==581.395
deutschemark == 171.233
Yen == 10471.2
