0% found this document useful (0 votes)
10 views29 pages

Java Currency Converter Project

The document outlines a project titled 'Currency Converter Using Java' developed by students of Shivalik Public School for their Class 12 IT curriculum. It details the project's objectives, methodology, system design, and includes source code for a Java-based application that converts currencies using fixed exchange rates. The project emphasizes practical application of programming concepts and highlights future enhancements such as real-time exchange rate integration and GUI development.

Uploaded by

Diksha Khera
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views29 pages

Java Currency Converter Project

The document outlines a project titled 'Currency Converter Using Java' developed by students of Shivalik Public School for their Class 12 IT curriculum. It details the project's objectives, methodology, system design, and includes source code for a Java-based application that converts currencies using fixed exchange rates. The project emphasizes practical application of programming concepts and highlights future enhancements such as real-time exchange rate integration and GUI development.

Uploaded by

Diksha Khera
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SHIVALIK PUBLIC SCHOOL

CURRENCY CONVERTER

SUBMITTED BY:
Name: Aditya,
Anmol
& Diksha

Class: XII
SESSION: 2025 – 2026
ACKNOWLEDGEMENT
I would like to express my sincere gratitude to all those who helped me
complete this project titled “Currency Converter Using Java” for Class
12 – IT 802.

First and foremost, I am extremely grateful to my IT teacher, Ms.


Shama Sharma for providing continuous guidance, encouragement, and
valuable suggestions throughout the project. Their support has played a
major role in the successful completion of this work.

I would also like to thank my school principal, my classmates, and


my parents for providing the necessary resources, motivation, and
support during this project.

This project has given me a wonderful opportunity to apply my classroom


knowledge to a real-life application and to develop a deeper
understanding of Java programming.

Finally, I would like to thank everyone who directly or indirectly


helped me in completing this project successfully.

Student Name
Class XII
Roll No. _______

INDEX PAGE
S. Page
Topic
No. No.

1. Cover Page 1

2. Acknowledgement 2

3. Index Page 3

4. Introduction 4

5. Objectives 5

6. Problem Statement 6

7. Scope 7

8. Hardware & Software Requirements 8

9. Methodology 9

Software Development Process


10. 10
(SDLC)

11. System Design / Flowchart 11

12. Source Code (Java Swing) 12

13. Output Screenshots 13

14. Testing 14

15. Advantages 15

16. Limitations 16

17. Future Scope 17

18. Conclusion 18

19. Bibliography 19

Introduction
In today’s globalized world, currency conversion has become a basic need
for travellers, business professionals, online shoppers, and financial
partners. With the increasing use of digital platforms, applications that
can convert currencies quickly and accurately are in high demand.
This project titled “Currency Converter Using Java” has been
developed as part of the Class 12 IT (802) curriculum to demonstrate
practical implementation of fundamental programming concepts.

The project is a simple Java-based console application that allows users to


convert amounts between various currencies using predefined exchange
rates. The program uses variables, data types, conditional
statements, loops, and switch-case constructs, which are essential
concepts in Java.

The project is designed to be simple enough for beginners yet functional


enough to demonstrate real-world usefulness. Although it currently uses
static exchange rates, it can be expanded into a more complex and robust
system by integrating APIs or building a graphical user interface.
Objectives of the Project
The major objectives of the project include:

1. To design and implement a Java program capable of converting


values between selected currencies.
2. To apply fundamental Java programming concepts, such as
variables, operators, conditional statements, switch-case
statements, and user input handling.
3. To perform mathematical operations for currency conversion
accurately.
4. To enhance computational thinking and logical reasoning
required to build real-life applications.
5. To create a user-friendly interface that allows users to select
conversion options easily.
6. To understand the structure of Java programming, including
compilation, execution, and debugging.
7. To gain practical knowledge of handling real-world problems
using technology.

Problem Statement
Currency conversion plays an important role in international travel, trade,
e-commerce, and foreign exchange transactions. Without a proper tool,
users may find it difficult to manually calculate conversions due to
continuously fluctuating exchange rates.

The problem arises when:

 Users need instant conversions


 Calculations must be error-free
 Values must be accurate
 Manual methods are slow and inconvenient

To solve this issue, a Java-based currency converter application has been


developed. It provides fast and accurate results by applying fixed
conversion rates with minimal user interaction. The program ensures that
even a beginner user can carry out conversions easily.

Scope of the Project


The scope of this project includes:

 Conversion of Indian Rupees (INR) to major currencies such as USD,


EURO, and GBP
 Conversion from these foreign currencies back to INR
 Providing a simple console-based text interface
 Displaying accurate results with mathematical precision
 Allowing easy modifications to add more currencies
 Possibility for future improvements such as a GUI and real-time API
integration

This project is especially useful in academic settings for demonstrating


Java programming skills.
Hardware and Software
Requirements
Hardware Requirements
1. Computer / Laptop
o Minimum 2 GB RAM
o 500 MB free disk space
o Dual-Core Processor or above
2. Input/Output Devices
o Keyboard for entering inputs
o Monitor for displaying outputs

Software Requirements

1. Operating System
o Windows / Linux / macOS
2. Programming Tools
o JDK (Java Development Kit) installed
o Any Java IDE such as:
 NetBeans
 Eclipse
 IntelliJ IDEA
 BlueJ
 Notepad or any text editor

3. Java Runtime Environment (JRE) for execution.


Methodology
The development of the currency converter application followed a
systematic methodology:

Step 1: Understanding Requirements

The basic requirement was to convert values between different

currencies. This includes deciding which currencies to support and what

operations to perform.

Step 2: Designing User Interaction

A simple console-based interface was chosen. The user selects a

conversion option and enters an amount.

Step 3: Defining Exchange Rates

Fixed exchange rates are stored as variables in the program. These rates

can be modified anytime.

Step 4: Coding the Application

A Java program was written using conditional statements and switch-case

to handle user choices and perform calculations.


Step 5: Testing

Multiple test cases were checked:

 Small values

 Large values

 Invalid options

 Zero input

Step 6: Final Review

The output was verified to ensure correctness and user-friendliness.


Software Development Process
The development of the Currency Converter Application follows the
standard Software Development Life Cycle (SDLC). SDLC helps in
creating a structured, efficient, and high-quality software product. The
major phases used in this project include:

1. Requirement Analysis
In this phase, the requirements of the project were clearly identified.
Key points analyzed:

 The program must convert currencies between INR, USD, EURO, and
GBP.
 The user should be able to select a conversion type.
 The program must accept numeric input (amount).
 The output should display accurate converted values.
 The program should run in a console environment using Java.

This phase helped in understanding the goals, expected output, and


required features.

2. System Design
During this phase, the structure and functioning of the system were
planned.
This included:

 Designing the user interface (menu-driven console interface)


 Preparing the flowchart
 Selecting data types and variables
 Deciding the conversion logic and formulas
 Planning how exchange rates would be stored
 Determining how user inputs would be handled

System design ensured that the implementation phase would be smooth


and error-free.
3. Implementation (Coding)
This is the stage where the actual Java program was written using the
designed plan.

Key points of implementation:

 Java Scanner class used for input


 Switch-case used for menu handling
 Variables declared for storing exchange rates
 Mathematical operations used to calculate converted values
 Output displayed using [Link]()

Clear coding practices and comments were added to make the code
readable and easy to understand.

4. Testing
After implementation, the program was tested thoroughly.

Test types performed:

 Functional Testing: Ensured all menu options work correctly


 Input Testing: Tested various inputs (positive numbers, zero, large
numbers)
 Boundary Testing: Tested conversions with very small or large
values
 Error Handling: Checked behavior for invalid menu options

Sample outputs were verified to ensure accuracy.


5. Deployment
Once the program passed all tests, it was considered ready for use.
Deployment steps included:

 Running the program on a standard Java environment


 Checking compatibility with different systems
 Packaging the source code for project submission

Deployment ensures that the project is ready to run on any system with
JDK installed.

6. Maintenance & Future Enhancements


Although the current application works efficiently, future improvements
can be easily added, such as:

 Real-time exchange rate updates using an API


 GUI interface using Java Swing or JavaFX
 Adding more currencies
 Converting directly between foreign currencies (e.g., USD to EURO)
 Including error validation for invalid numeric inputs

Maintenance ensures the project can grow and evolve in the future.
Summary of SDLC for this
Project
SDLC Phase Activities Performed
Requirement Understanding user needs & project
Analysis goals

Creating flowchart, planning logic &


System Design
interface

Implementation Writing Java program

Verifying accuracy, stability, and


Testing
performance

Deployment Running and preparing final output

Identifying improvements & future


Maintenance
enhancements
System Design
Flowchart
┌──────────────────────┐
│ Start │
└─────────┬────────────┘

┌─────────▼────────────┐
│ Display Menu Options │
└─────────┬────────────┘

┌─────────▼────────────┐
│ User Selection │
└─────────┬────────────┘

┌─────────▼────────────┐
│ Enter Amount │
└─────────┬────────────┘

┌─────────▼────────────┐
│ Perform Calculation │
└─────────┬────────────┘

┌─────────▼────────────┐
│ Display Result │
└─────────┬────────────┘

┌─────────▼────────────┐
│ End │
└──────────────────────┘
SOURCE CODE (JAVA )

import [Link].*;
import [Link].*;
import [Link].*;

public class CurrencyConverter extends JFrame {

private JComboBox<String> fromCurrency;


private JComboBox<String> toCurrency;
private JTextField inputAmount;
private JLabel resultLabel;
private JButton convertButton;

double usdToInr = 86.25;


double usdToEuro = 0.93;
double usdToAed = 3.67;

public CurrencyConverter() {

setTitle("Currency Converter - Java Swing");


setSize(420, 350);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(null);
setResizable(false);

JLabel title = new JLabel("Currency Converter");


[Link](new Font("Arial", [Link], 20));
[Link](110, 10, 300, 40);
add(title);

JLabel fromLabel = new JLabel("From:");


[Link](40, 70, 100, 30);
add(fromLabel);

fromCurrency = new JComboBox<>(new String[]{"USD",


"INR", "AED", "EURO"});
[Link](140, 70, 200, 30);
add(fromCurrency);

JLabel toLabel = new JLabel("To:");


[Link](40, 120, 100, 30);
add(toLabel);

toCurrency = new JComboBox<>(new String[]{"USD",


"INR", "AED", "EURO"});
[Link](140, 120, 200, 30);
add(toCurrency);

JLabel amountLabel = new JLabel("Amount:");


[Link](40, 170, 100, 30);
add(amountLabel);

inputAmount = new JTextField();


[Link](140, 170, 200, 30);
add(inputAmount);

convertButton = new JButton("Convert");


[Link](140, 220, 100, 35);
add(convertButton);

resultLabel = new JLabel("Converted Amount: ");


[Link](40, 270, 300, 30);
add(resultLabel);

[Link](new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
convertCurrency();
}
});
}

public void convertCurrency() {


try {
double amount =
[Link]([Link]());
String from = (String) [Link]();
String to = (String) [Link]();

double result = convert(from, to, amount);


[Link]("Converted Amount: " +
[Link]("%.2f", result));
} catch (Exception ex) {
[Link](this, "Enter a valid
amount!", "Error", JOptionPane.ERROR_MESSAGE);
}
}

public double convert(String from, String to, double amount)


{
double amountInUSD = switch (from) {
case "INR" -> amount / usdToInr;
case "AED" -> amount / usdToAed;
case "EURO" -> amount / usdToEuro;
default -> amount;
};

return switch (to) {


case "INR" -> amountInUSD * usdToInr;
case "AED" -> amountInUSD * usdToAed;
case "EURO" -> amountInUSD * usdToEuro;
default -> amountInUSD;
};
}

public static void main(String[] args) {


new CurrencyConverter().setVisible(true);
}
}
Output Screen / Screenshots

The following screenshots demonstrate the functionality of the


GUI-based Currency Converter application. The screenshots
show the user interface, input fields, dropdowns for selecting
currencies, the Convert button, and the output of converted
amounts.

Figure 1: Main Window of Currency Converter

 This window displays the title, “Currency Converter,” dropdown


menus for selecting “From” and “To” currencies, an input field for
the amount, a Convert button, and a label showing the converted
amount.
Figure 1

Figure 2: Conversion Example – USD to INR

 User selects USD as the “From” currency, INR as the “To” currency,
and enters an amount (e.g., 5 USD).
 The converted amount is displayed in the label below the Convert
button.

Figure 2
Figure 3: Conversion Example – INR to EURO

 User selects INR as the “From” currency, EURO as the “To”


currency, and enters an amount (e.g., 500 INR).
 The application calculates and displays the converted value.
Figure 3

Figure 4: Error Handling

 If the user enters an invalid value (e.g., text or empty input), a pop-
up error message is displayed prompting the user to enter a valid
number.

Figure 4
SAMPLE OUTPUT (GUI)
1. Application Window:

 Title: Currency Converter


 Dropdown menus
 Input field
 Convert button
 Result label

2. Example Conversion:

 From: USD
 To: INR
 Amount: 250

Output: Converted Amount: 21562.50


TESTING
Test Expected
Input
Case Output Result
1 100 USD → INR 8625
Pass
Converted
2 50 AED → EURO
value Pass
Invalid input Error
3
“abc” message Pass
4 0 amount 0
Pass
Same
5 Same currency
amount Pass
Advantages

 Fast and accurate currency conversion

 User-friendly interface

 Easily understandable code

 No internet connection required

 Can convert currencies both ways

 Platform-independent (Java runs everywhere)


Limitations

 Uses fixed exchange rates (not real-time)

 No GUI (only console-based)

 Limited number of currencies

 Cannot handle invalid amount inputs gracefully


Future Scope
 Adding real-time currency rates using APIs (e.g. Forex API)

 Creating a graphical interface using Java Swing or JavaFX

 Adding more currencies like Yen, Dirham, Dinar, Yuan, etc.

 Making a mobile app version using Java/Kotlin

 Integrating voice-based input


Conclusion
The Currency Converter project successfully demonstrates how
Java programming can be used to build practical, real-world
applications. The project uses fundamental Java constructs
such as variables, conditional statements, loops, and user input
handling.

It is simple, efficient, and easily extendable. Through this


project, the learner gains confidence in Java programming and
understands the importance of computational logic in
developing applications.

The program provides a solid foundation for more advanced


projects in future academic and professional fields.

Bibliography
 NCERT Information Technology (802) Textbook

 Oracle Java Documentation

 Online Java Programming Tutorials

 Classroom Lecture Notes

You might also like