Skip to content

A Java-based console application for converting currency between USD, EUR, GBP, CAD, AUD, and INR using predefined exchange rates. Designed for quick and easy currency conversions directly from the terminal.

Notifications You must be signed in to change notification settings

Ritu073/Currency-Converter-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Currency Converter

A Java-based console application that converts amounts between different currencies using predefined exchange rates. This program supports conversions among six major currencies, simplifying the conversion process by using INR as an intermediary.

Features

  • Convert between any two of the supported currencies: USD, EUR, GBP, CAD, AUD, and INR.
  • Predefined exchange rates: The rates are hardcoded for simplicity.
  • Console-based interaction: Easy-to-use console prompts guide the user through the currency conversion process.

Supported Currencies

  • USD - United States Dollar
  • EUR - Euro
  • GBP - British Pound
  • CAD - Canadian Dollar
  • AUD - Australian Dollar
  • INR - Indian Rupee

Exchange Rates

The exchange rates are based on the following conversions to INR (Indian Rupee):

  • USD to INR: 84.10
  • EUR to INR: 90.82
  • GBP to INR: 109.02
  • CAD to INR: 60.52
  • AUD to INR: 55.63

Getting Started

Prerequisites

  • Java Development Kit (JDK) installed on your system
  • A Java-compatible IDE or a text editor with console support

Usage

  • Follow the prompts to select the source and target currencies.
  • Enter the amount to convert.
  • The program will display the converted amount.

Example

To convert 100 GBP to CAD, follow these steps:

  • Select 3 for GBP as the source currency.
  • Select 4 for CAD as the target currency.
  • Enter 100 as the amount.
  • The output will display the converted amount in CAD.

Code Structure

The program consists of a switch statement in two steps:

  1. Conversion to INR: Converts the source currency to INR using predefined exchange rates.
  2. Conversion from INR: Converts the INR amount to the target currency.

Future Improvements

  • Live Exchange Rates: Integrate with an API to fetch real-time exchange rates.
  • Error Handling: Enhance validation for more robust user interaction.
  • Additional Currencies: Support more currencies beyond the six currently available.

About

A Java-based console application for converting currency between USD, EUR, GBP, CAD, AUD, and INR using predefined exchange rates. Designed for quick and easy currency conversions directly from the terminal.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages