Answered step by step
Verified Expert Solution
Link Copied!

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:
mdalton/Public/exchange.txt
The file has the following format.
Currencyabreviation CurrencyName AmountForEachUSDollar
USD USDOllar 1.0
EUR Euro 1.1
GBP BritishPound 1.3
CAD CanadianDollar 0.74dots
In addition, every exchange will cost 1.5% 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 1.5% exchange charge and then applies the exchange rate.
Suggestion: Subtract the 1.5% 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: 500
You get: 280.35 CanadianDollars
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 15th International Conference Dexa 2004 Zaragoza Spain August 30 September 3 2004 Proceedings Lncs 3180

Authors: Fernando Galindo ,Makoto Takizawa ,Roland Traunmuller

2004th Edition

3540229361, 978-3540229360

More Books

Students also viewed these Databases questions

Question

8. Explain the contact hypothesis.

Answered: 1 week ago

Question

2. Define the grand narrative.

Answered: 1 week ago