View the step-by-step solution to:

choose five international source currencies to monitor. Each currency is referenced with a three letter ISO 4217 currency code. For example, the code...

choose five international source currencies to monitor. Each currency is referenced with a three letter ISO 4217 currency code. For example, the code for the British Pounds is GBP. Search online for these abbreviations with a search string such as "ISO 4217 Currency Codes." Place these currency codes in a text file named currency.txt.
 
The following URL is a link to a CSV file that contains the exchange rate for a given source and target currency. For example, if the source currency is EUR and the target currency is USD, the URL is
http://data.fixer.io/api/latest?access_key=
     <<Your access key goes here>>&symbols=GBP
The returned JSON string is
{"success":true,"timestamp":1538281746,"base":"EUR",
 "date":"2018-09-30","rates":{"GBP":0.891903}}






public static String getCurrency(Scanner s)
public static String getUrlString(String targetCurrency)
public static double getExchangeRate(String urlString)


create
 File object for currencies.txt
create scanner1 to read from input file
create new DefaultCategoryDataset object to 
    contain bars for histogram
while more lines in input file
    read target currency using scanner1
    construct URL for obtaining target exchange rate
    create scanner2 from URL
    use URL to obtain JSON string
    extract target exchange rate from JSON string
    add histogram bar representing target 
        exchange rate to DefaultCategoryDataset object
    close scanner2
end while
create a bar chart object from DefaultCategoryDataset
    object
create graphics image file
close scanner1

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question