Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PART C C + + This program allows the user to calculate the amount of money he or she will be given when travelling between
PART C C
This program allows the user to calculate the amount of money he or she will be given when travelling between countries.
You can download some current exchange rates from:
mdaltonPublicexchangetxt
The file has the following format.
Currencyabreviation CurrencyName AmountForEachUSDollar
USD USDOllar
EUR Euro
GBP BritishPound
CAD CanadianDollar dots
In addition, every exchange will cost of the money to be exchanged.
Your program will have two menus:
Enter the abbreviation for your current currency.
USD
EUR
GBP
CAD
AUD
JPY
INR
CHF
ZAR
HKD
SEK
MXN
DKK
Which do you choose?
And
Enter the abbreviation for your new currency.
USD
EUR
GBP
All inputs must be validated.
Write a function called loadArrays that takes three arrays as parameters. This function opens an input file to get the current exchange rates.
Write a function called exchange that takes two arrays and an amount of money. This function returns the amount after the exchange charge and then applies the exchange rate.
Suggestion: Subtract the exchange charge, then convert to USD, then convert to the desired currency.
Sample Run:
Enter the abbreviation for your current currency.
USD
EUR
GBP
CAD
AUD
JPY
INR CHF
ZAR
HKD
SEK
MXN
DKK
Which do you choose? GBP
Enter the abbreviation for your new currency.
USD
EUR
GBP
CAD
JPY
INR
CHF
HKD
SEK
MXN
DKK
Which do you choose? CAD
Enter the amount to exchange:
You get: CanadianDollars
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started