Run the Application
Once you’ve installed and compiled the Currency Converter, you’re ready to perform your first conversion.Run the Application
From the project root directory, run:You should see the welcome menu:
On Windows, use a semicolon instead of a colon:
java -cp "out;lib/gson-2.10.1.jar" ...Enter the Amount
When prompted, enter the amount you want to convert:The application will:
- Make an HTTP request to ExchangeRate-API
- Fetch the current USD to ARS exchange rate
- Calculate the conversion
- Display the result
- Save the conversion to history
Exchange rates are fetched in real-time, so your result may differ based on current market rates.
Try Another Conversion
The menu will appear again. Let’s convert Brazilian Real to USD. Type Result:
4:View Conversion History
To see all your conversions, select option You’ll see a formatted history with timestamps:
7:History is stored in memory and will be cleared when you exit the application.
Understanding the Menu Options
Here’s what each menu option does:- Options 1-6: Conversions
- Option 7: History
- Option 8: Exit
Currency Pair Conversions
Each conversion:
| Option | From | To | Example |
|---|---|---|---|
| 1 | USD | ARS | Convert dollars to Argentine pesos |
| 2 | ARS | USD | Convert Argentine pesos to dollars |
| 3 | USD | BRL | Convert dollars to Brazilian reais |
| 4 | BRL | USD | Convert Brazilian reais to dollars |
| 5 | USD | COP | Convert dollars to Colombian pesos |
| 6 | COP | USD | Convert Colombian pesos to dollars |
- Fetches the current exchange rate from ExchangeRate-API
- Performs the calculation server-side for accuracy
- Returns the result in the target currency
- Saves the conversion to your session history
Example Session
Here’s a complete example session:Behind the Scenes
When you perform a conversion, here’s what happens:API Request
The application makes an HTTP GET request to ExchangeRate-API:Example:
https://v6.exchangerate-api.com/v6/API_KEY/pair/USD/ARS/100Common Tasks
Convert a specific amount
Convert a specific amount
- Run the application
- Select the appropriate currency pair (options 1-6)
- Enter your amount when prompted
- View the converted result
Track multiple conversions
Track multiple conversions
- Perform several conversions using different currency pairs
- Select option 7 to view your complete history
- All conversions are listed with timestamps
Compare exchange rates over time
Compare exchange rates over time
- Perform a conversion and note the rate
- Wait a few minutes or hours
- Perform the same conversion again
- View history (option 7) to compare the results
Exchange rates update frequently based on market conditions.
Recover from invalid input
Recover from invalid input
If you enter an invalid option:The menu will reappear, allowing you to select a valid option.
Next Steps
Now that you’ve completed your first conversion, explore more:Architecture
Learn how the application is structured
Code Structure
Explore the codebase and class documentation
API Integration
Understand how ExchangeRate-API is integrated
Using the Converter
Learn advanced usage patterns