Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program to display a currency conversion table for U.S. Dollar to five other currencies. See the example below. (15 pts) jGRASP exec:

image text in transcribed image

Write a program to display a currency conversion table for U.S. Dollar to five other currencies. See the example below. (15 pts) jGRASP exec: java CurrencyConvertTable US Dollar 100.00 || CN Yuan | EURO British Pound Canada Dollar Japanese Yen ||718.00 | 103.00 89.40 138.90 14881.00 150.00 ||1077.00 154.50 134.10 208.35 22321.50 200.00 ||1436.00 206.00 178.80 277.80 29762.00 250.00 ||1795.00 | 257.50 223.50 347.25 37202.50 300.00 ||2154.00 | 350.00 400.00 2513.00 | ||2872.00 | 309.00 | 360.50 268.20 | 416.70 44643.00 312.90 486.15 | 52083.50 412.00 | 357.60 555.60 59524.00 450.00 ||3231.00 | 463.50 402.30 625.05 66964.50 447.00 | 694.50 74405.00 500.00 || 3590.00 | 515.00 Requirements: a) You need two java classes and files for this question. Make sure you save these two java files in the same folder on your computer, so they will be considered as in the same package. b) One java class can be called CurrencyConversion, and thus the java file named CurrencyConversion.java. This should be a container class that contains at least five methods, which convert US dollar to CN Yuan, EURO, British Pound, Canada Dollar and Japanese Yen. You could add more other methods in this class later to convert to more other currencies if you want. No main method is needed in this class. c) Feel free to Google for the latest currency rates. Or you can use the rates below: 1 dollar 7.183 CNY; 1.028 EURO; 0.894 BP; 1.389 CND; or 148.778 JPY If you use different currency rates, the values showing in your table might be slightly different from the example above, which is totally fine!!! d) The second java class can be called CurrencyConvertTable, and thus the java file named CurrencyConvertTable.java. This class has a main method that will invoke (call) the five converting methods from the CurrencyConversion class and print a conversion table. e) Make sure you still display the table in the exact format like the one in the example. All the numbers should show 2 decimal places. The numbers in each column should align to the right of the column header. Consider to use \t before and after each column value ||to separate USD column from the rest table, and to separate the other columns in the table. f) Program styles like program top comment block, indentation, alignment, name conventions, etc. are all required.

Step by Step Solution

3.41 Rating (160 Votes )

There are 3 Steps involved in it

Step: 1

CurrencyConversionjava import javatextDecimalFormat public class CurrencyConversion Currency convers... 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

An Introduction To Network Programming With Java

Authors: Jan Graba

3rd Edition

1447152530, 978-1447152538

More Books

Students also viewed these Programming questions

Question

What did the Becquerel discover about uranium?

Answered: 1 week ago