Question
The text file Exchrate.txt gives information about the currencies of 49 major countries. The first eight lines of the file are as follows: Each line
The text file Exchrate.txt gives information about the currencies of 49 major countries. The first eight lines of the file are as follows:
Each line of the file gives the name of a country, the name of its currency, and the number of units of the currency that were equal to one American dollar (called the exchange rate4 ). For instance, one American dollar is equal to 591.4077 Chilean pesos. Use the text file Exchrate.txt in parts (a), (b), and (c).
(a) Write a program that requests the name of a county as input and then displays the name of its currency and its exchange rate. See Fig. 5.52.
(b) Write a program that displays the names of the countries in ascending order determined by the number of units that can be purchased for one American dollar. Figure 5.53 shows the first three countries displayed.
(c) Write a program that requests the names of two countries and an amount of money, and then converts the amount from the first countrys currency to the equivalent amount in the second countrys currency. See Fig. 5.54.
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