Question: C++ In this exercise, you will write a program to convert money in different currencies. The program takes as input the original currency, the amount,
C++
In this exercise, you will write a program to convert money in different currencies. The program takes as input the original currency, the amount, and the currency to convert to, and outputs the amount in the new currency with double digit precision.
For example, given the input
EUR 2 USD
The output should be
2.46
The valid currencies for this program are Euros, American dollars and Yens. They will be entered using 3 letters identifiers: EUR, USD, YEN.
Use the following values for the conversions (you should be able to use these values to convert in both directions):
- 1 EUR = 1.23 USD
- 1 EUR = 126.20 YEN
- 1 USD = 102.80 YEN
If the user enters the wrong identifier for one of the currencies (that is, anything other than EUR, USD or YEN), print the message
Invalid input
End all messages with a new line.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
