This Java application allows users to convert currencies using the Exchange Rate API. It uses Gson for JSON manipulation and HttpClient for API requests.
- Clone this repository to your local machine.
- Open the project in IntelliJ IDEA or your preferred Java IDE.
- Make sure you have Gson and HttpClient libraries added to your project dependencies.
- Replace the API key in the
CurrencyApi.java
file with your own API key.
- Run the
CurrencyConverterApp.java
file to start the application. - Enter the base currency (e.g., USD), the amount to convert, and the target currency (e.g., EUR) when prompted.
- The application will fetch the latest exchange rates from the API and display the converted amount.
CurrencyApi.java
: Contains methods to fetch exchange rates from the API.JsonParser.java
: Parses JSON responses from the API.CurrencyConverter.java
: Performs currency conversion calculations.CurrencyConverterApp.java
: Main class for user interaction via console.
- Gson: link to Gson
- HttpClient: link to HttpClient
You need to obtain an API key from Exchange Rate API and replace it in the CurrencyApi.java
file to use the application.