Student Interview Question for Students
- 0of 0 votes
AnswersProgramming Exercise – FX Calculator
- princerajesh.indukuri May 06, 2017 in India
Your task is to create a console-based currency converter application.
Requirements
The application allows a user to convert an amount in a specific currency to the equivalent amount in another currency.
Your calculator should allow a user to enter an amount in any of the known currencies, and provide the equivalent amount in another currency.
Your calculator should parse console input like "<ccy1> <amount1> in <ccy2>", and provide a suitable response.
For example:
%> AUD 100.00 in USD
AUD 100.00 = USD 83.71
%> AUD 100.00 in AUD
AUD 100.00 = AUD 100.00
%> AUD 100.00 in DKK
AUD 100.00 = DKK 505.76
%> JPY 100 in USD
JPY 100 = USD 0.83
If the rate cannot be calculated, the program should alert the user:
%> KRW 1000.00 in FJD
Unable to find rate for KRW/FJD
When displaying amounts back to the user, they should be formatted with the precision given below:
AUD=2 decimal places| Report Duplicate | Flag | PURGE
Student Student Java
Interview Type: Written Test