Question
2. Create an entire program that allows a user to exchange other currencies for US Dollars.
Your program should first display a menu of possible exchanges:
To Convert Canadian Dollars to US Dollars choose 1
To Convert Euros to US Dollars choose 2
To Convert Indian Rupees to US Dollars choose 3
To Convert Japanese Yen to US Dollars choose 4
To Convert Mexican Pesos to US Dollars choose 5
Enter choice:
After the user chooses an exchange currency, the program should ask the user if they are a US Resident, and set a resident flag in the program according to the answer.
Are you a US Resident? [Y/N]:
Finally, your program should prompt for the number of foreign currency units to convert and should calculate and display the appropriate exchange value using the following scales.
Currency Resident exchange rate Non-resident exchange rate
Canadian Dollars .9813 1.00
Euros .757 .8
Indian Rupees 52.53 55
Japanese Yen 80.92 85
Mexican Pesos 13.15 15
For user input:
Enter choice: 4
Are you a US Resident? [Y/N]: N
Enter foreign currency units: 80000
Should generate output:
80000 Yen can be exchanged for 941.17 US Dollars.
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
#include <iostream>using namespace std;
int main()
{
int choice, num1, num2,
result;
cout << "Enter number 1: ";
cin >> num1;
cout << "Enter number 2: ";
cin >> num2;
cout << "Choices: \n1. Add the numbers\n2. Computer the difference of the numbers\n3. Compute the product\n4. Compute the quotient (assuming number 2 isn't 0\nEnter code: ";
cin >> choice;
if(choice == 1)
result = num1+num2;
else if(choice == 2)
result = num1-num2;
else if(choice == 3)...