0% found this document useful (0 votes)
9 views

Currency Converter In Java

The document is a micro project report for a Currency Converter application developed in Java by students of the Sanjay Bhokare Group of Institutes. It outlines the project's aim, resources required, code structure, and its educational significance in teaching Java programming and GUI development. The project emphasizes user experience, error handling, and potential future enhancements, making it a practical tool for currency conversion.

Uploaded by

ajimlaptop720
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Currency Converter In Java

The document is a micro project report for a Currency Converter application developed in Java by students of the Sanjay Bhokare Group of Institutes. It outlines the project's aim, resources required, code structure, and its educational significance in teaching Java programming and GUI development. The project emphasizes user experience, error handling, and potential future enhancements, making it a practical tool for currency conversion.

Uploaded by

ajimlaptop720
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Shree Ambabai Talim Sanstha’s

SANJAY BHOKARE GROUP OF INSTITUTES, MIRAJ


FACULTY OF POLYTECHNIC
Institute Code:1552
Department of Artifical Intelligence
and
Machine Learning Engineering
Micro Project Report
On

Currency Converter In Java


Prepared By
SR NAME OF STUDENT ROLL NO. ENROLLEMENT NO.
NO.
1. SNEHA ARVIND SHINDE 2234 23213180039
2. VIJAY SHINGADE SHANKAR 2235 23213180040
3. AJIM JAVED TAMBOLI 2236 23213180041

Under The Guidance Of


Ms. S. P. Sakhalkar
Submitted To

Maharashtra State Board of Technical Education, Mumbai


(Autonomous) (ISO-9001-2008) (ISO/IEC 27001:2013)
Academic Year 2024-2025
MAHARASHTRA STATE
BOARD OF TECHNICAL EDUCATION
Certificate
(Only for Micro Project report)

This is to certify that following student,


Roll no Enrollment No. Exam seat No Name
2234 23213180039 SNEHA ARVIND
SHINDE
2235 23213180040 VIJAY SHIGADE
SHANKAR
2236 23213180041 AJIM JAVED
TAMBOLI

Of 4rd Semester of Diploma in Artifical Intelligence and Machine Learning


Engineering, of institute ATS Sanjay Bhokare Group Of Institutes, Faculty of
Polytechnic, Miraj (code:1552) have completed the Micro Project Work
Satisfactorily in course JAVA PROGRAMMING (314317) For the academic year
2024-25 as prescribed in the curriculum

Place: Miraj.

Date: ……………

Subject Teacher Head of the Department Principal


Title of Micro Project:
Currency Converter In Java

1.0 Brief Introduction


The Currency Converter project is a Java-based application designed to facilitate the conversion
of various currencies, addressing a fundamental need in today's global economy. With an intuitive
graphical user interface built using the Swing framework, users can easily input amounts and select
currencies for conversion. The application supports a range of popular currencies, including USD,
EUR, JPY, GBP, CAD, AUD, CHF, CNY, and INR, allowing for versatile use in different
financial contexts. The conversion process is straightforward, utilizing predefined exchange rates
to provide real-time results, while basic error handling ensures that users receive clear feedback
for invalid inputs. This project not only showcases essential programming concepts but also
emphasizes the importance of user experience in software design. Future enhancements could
include integrating real-time exchange rates from external APIs and improving the overall
interface, making the Currency Converter a valuable tool for individuals and businesses alike.

2.0 Aim of the Micro-Project

This Micro-Project aims to:

1. User -Friendly Interface: Develop an intuitive GUI for easy navigation.


2. Multi-Currency Support: Enable conversion between various currencies.
3. Real-Time Conversion: Provide instant conversion results based on exchange rates.
4. Error Handling: Implement clear feedback for invalid inputs.
5. Educational Tool: Serve as a resource for learning currency conversion and Java
programming.
6. Extensibility: Allow for future enhancements and additional features.
7. Data Formatting: Ensure clear and professional display of currency values.
8. Practical Application: Demonstrate real-world application of Java programming skills

Team Members :

1. Sneha Arvind Shinde


2. Vijay Shigade Shankar
3. Ajim Javed Tamboli
3.0 Resources Required
Name of
S.N. Specifications Quantity Remarks
Resource/Material

Java Development Kit Version 8 or higher for Required for compiling


1 1
(JDK) compatibility with Swing and running Java code.

Integrated Development Eclipse, IntelliJ IDEA, or For coding, debugging,


2 1
Environment (IDE) NetBeans and project management.

Included with JDK; no


Built-in Java library for
3 Swing Library N/A separate installation
GUI development
needed.

Open Exchange Rates,


Optional for real-time
4 Exchange Rate API CurrencyLayer, or 1
exchange rates.
similar

Oracle's Java
For reference and learning
5 Documentation documentation and N/A
purposes.
Swing tutorials

For managing code


Git or GitHub for version
6 Version Control System 1 versions and
control
collaboration.

To ensure functionality
JUnit or similar for unit
7 Testing Framework 1 and reliability of the
testing
application.
4.0 Source Code and Output
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DecimalFormat;

public class Currency_Converter extends JFrame {


private JLabel amountLabel, fromLabel, toLabel, resultLabel;
private JTextField amountField;
private JComboBox<String> fromComboBox, toComboBox;
private JButton convertButton;
private DecimalFormat decimalFormat = new DecimalFormat("#,##0.00");

private final String[] currencies = {"USD", "EUR", "JPY", "GBP", "CAD",


"AUD", "CHF", "CNY","INR"};
private double[] exchangeRates = {1.00, 0.84, 109.65, 0.72, 1.27, 1.30,
0.92, 6.47,87.14};

public Currency_Converter() {
setTitle("Currency Converter");
setLayout(new GridLayout(4, 2));

amountLabel = new JLabel("Amount:");


add(amountLabel);

amountField = new JTextField();


add(amountField);

fromLabel = new JLabel("From:");


add(fromLabel);

fromComboBox = new JComboBox<>(currencies);


add(fromComboBox);

toLabel = new JLabel("To:");


add(toLabel);

toComboBox = new JComboBox<>(currencies);


add(toComboBox);

convertButton = new JButton("Convert");


add(convertButton);
resultLabel = new JLabel();
add(resultLabel);

convertButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
double amount = Double.parseDouble(amountField.getText());
String fromCurrency = (String)
fromComboBox.getSelectedItem();
String toCurrency = (String) toComboBox.getSelectedItem();
double exchangeRate = exchangeRates[getIndex(toCurrency)] /
exchangeRates[getIndex(fromCurrency)];
double result = amount * exchangeRate;
resultLabel.setText(decimalFormat.format(result) + " " +
toCurrency);
} catch (Exception ex) {
resultLabel.setText("Invalid input");
}
}
});

setSize(300, 200);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}

private int getIndex(String currency) {


for (int i = 0; i < currencies.length; i++) {
if (currency.equals(currencies[i])) {
return i;
}
}
return -1;
}

public static void main(String[] args) {


new Currency_Converter();
}
}
 Output

5.0. Explanation of code


 Code Structure Overview
1. Main Class: The entry point of the application where the GUI is initialized.
2. GUI Components: Includes labels, text fields, combo boxes for currency selection, and
buttons for triggering the conversion.
3. Event Handling: Manages user interactions, such as button clicks, and performs the
conversion logic.
4. Conversion Logic: Contains the logic for converting one currency to another based on
predefined exchange rates.
 Explanation of Code Components
1. Imports: The code imports necessary classes from the javax.swing package for GUI
components and java.awt.event for handling events. It also imports DecimalFormat for
formatting the output.
2. Main Class (CurrencyConverter): This class contains all the components and logic for the
currency converter application.
3. GUI Initialization:
 A JFrame is created to serve as the main window of the application.
 Various GUI components are initialized, including labels, text fields, combo
boxes for currency selection, and a button for conversion.
 The layout is set to null to allow for absolute positioning of components.
4. Event Handling:
 An ActionListener is added to the "Convert" button. When clicked, it triggers
the convertCurrency() method.
5. Conversion Logic:
 The convertCurrency() method retrieves the amount entered by the user and the
selected currencies.
 It uses predefined

5.0. Conclusion
In conclusion, the Currency Converter project serves as a practical and educational tool that effectively
demonstrates the application of Java programming and graphical user interface (GUI) development
using the Swing framework. By successfully creating an intuitive and user-friendly application, this
project not only meets the essential need for currency conversion in a globalized economy but also
enhances the user experience through its clear layout and responsive design. The inclusion of multiple
currencies allows users to engage with a diverse range of financial scenarios, while the real-time
conversion feature, supported by predefined exchange rates, ensures that users receive accurate and
timely information. Furthermore, the project emphasizes the importance of robust error handling,
providing users with clear feedback for invalid inputs, which contributes to a more seamless interaction
with the application. As an educational resource, the Currency Converter project reinforces fundamental
programming concepts, such as event handling, data validation, and modular design, making it an
excellent learning experience for students and aspiring developers. Looking ahead, the potential for
future enhancements—such as integrating real-time exchange rates from external APIs, improving the
user interface, and expanding currency options—highlights the project's extensibility and relevance in
an ever-evolving technological landscape. Overall, the Currency Converter not only fulfills a practical
need but also serves as a testament to the capabilities of Java and the importance of user-centered
design in software development, paving the way for further exploration and innovation in financial
applications.

Micro-Project Evaluation Sheet

Process Assessment Product Assessment Total


Part A - Project Methodology Part B - Project individual Marks
Project (2 marks) Report/Working Presentation/Viva 10
Proposal Model (4 marks)
(2 marks) (2 marks)

Note:
Every course teacher is expected to assign marks for group evolution for each group of students in first 3
columns as per rubrics & individual evaluation in 4TH column for each group of studentsas per rubrics
based on viva.

Comments/Suggestions about teamwork/leadership/inter-personal communication (if any)


………………………………………………………………………………………………
……………………………………………………………………………………………..
……………………………………………………………………………………………..
……………………………………………………………………………………………..

Any Other Comment:


……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
………………………………………………………………………………………………

Name and designation of the Faculty Member…………………………………….

Signature………………………………………………………………………………

Date:……………………..

You might also like