Skip to content

A simple Java-based currency converter that uses hardcoded exchange rates to convert between USD, EUR, GBP, MYR, and JPY. Includes error handling for invalid inputs and negative amounts. Ideal for beginners learning Java.

License

Notifications You must be signed in to change notification settings

nurulashraf/java-currency-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Java Currency Converter

A simple Java-based currency converter that uses hardcoded exchange rates to convert between USD, EUR, GBP, MYR, and JPY. Includes error handling for invalid inputs and negative amounts. Ideal for beginners learning Java.

Features

  • Convert between USD, EUR, GBP, MYR, and JPY using fixed exchange rates.
  • Handles invalid inputs and negative values gracefully.
  • Console-based interface with a simple user prompt.

Installation & Usage

  1. Clone the repository:
    git clone https://github.com/nurulashraf/java-currency-converter.git
  2. Navigate to the project folder:
    cd java-currency-converter
  3. Compile the Java program:
    javac src/CurrencyConverter.java
  4. Run the program:
    java -cp src CurrencyConverter

Example Usage

Enter source currency (USD, EUR, GBP, MYR, JPY): USD
Enter target currency (USD, EUR, GBP, MYR, JPY): MYR
Enter amount to convert: 10
10.00 USD = 47.00 MYR

Repository Structure

java-currency-converter/
│── src/
│   ├── CurrencyConverter.java  # Main Java program
│── README.md                    # Project documentation
│── LICENSE                      # MIT License file

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A simple Java-based currency converter that uses hardcoded exchange rates to convert between USD, EUR, GBP, MYR, and JPY. Includes error handling for invalid inputs and negative amounts. Ideal for beginners learning Java.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages