0% found this document useful (0 votes)
6 views13 pages

Java Currency Converter Mini Project

Uploaded by

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

Java Currency Converter Mini Project

Uploaded by

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

Pune District Education Association’s

INSTITUTE OF TECHNOLOGY, Hadapsar.

“Currency Converter System”

Submitted By-
Aakanksha Naiknaware
Ajinkya Nawale

Semester 5
Computer Department
Advanced Java Programming Micro-Project
Pune District Education Association’s

INSTITUTE OF TECHNOLOGY, Hadapsar.

 Abstract:
A Currency Converter is a System that performs various operations on
Currency. The simplest currency converter can do only simple conversion of
the currency like rupees to dollars.
This course develops necessary skills in students to apply object oriented
programming techniques in java so that students will be able to developed
complete application using core java.
Different countries use different currency, and there is daily variation in these
currencies relative to one another. Those who transfer money from one
country to another (one currency to another) must be updated with the latest
currency exchange rates in the market.

Currency converter mini project is built keeping this thing in mind. It is simply
a calculator-like app developed using Ajax, Java servlets web features. In this
application, there is regular update about currency of every country by which
it displays present currency market value and conversion rate.

Such application can be used by any user, but it is mainly useful for business,
shares, and finance related areas where money transfer and currency exchange
takes place on a daily basis.

In this currency converter app, users are provided with an option to select the
type of conversion, i.e. from “this” currency to “that” currency. This simple
feature allows users to enter amount to be converted (say currency in Dollars),
and display the converted amount.

 Requirements for the project:

 A minimum of two systems is required for the project.


 Processor Intel P4
 Hard disk of 40 GB
 RAM of 512 MB
Pune District Education Association’s

INSTITUTE OF TECHNOLOGY, Hadapsar.

 Standard wireless/ wired network with either Ad-hoc.


 Operating system either windows or Linux
 Software needed are java SDK 2, Borland Net beans 6.0

 Introduction:

Currency converter (or currency exchange) is a mini project coded in Java


programming language. This simple application provides a web-based
interface for exchanging/converting money from one currency (say $) to
another currency (say €).

Different countries use different currency, and there is daily variation in these
currencies relative to one another. Those who transfer money from one
country to another (one currency to another) must be updated with the latest
currency exchange rates in the market.

Currency converter mini project is built keeping this thing in mind. It is simply
a calculator-like app developed using Ajax, Java servlets web features. In this
application, there is regular update about currency of every country by which
it displays present currency market value and conversion rate.

Such application can be used by any user, but it is mainly useful for business,
shares, and finance related areas where money transfer and currency exchange
takes place on a daily basis.

In this currency converter app, users are provided with an option to select the
type of conversion, i.e. from “this” currency to “that” currency. This simple
feature allows users to enter amount to be converted (say currency in Dollars),
and display the converted amount.

Java APl packages/ Built-in packages:

i) Java APL provides a number of classes grouped into different package


according to their functionality.

ii) The already defined package like [Link].*, [Link].*, etc. are known as
built-in package.
Pune District Education Association’s

INSTITUTE OF TECHNOLOGY, Hadapsar.

iii) There are six main packages are present in Java programming language.

iv) Folliwing tables gives the information about the java system package and
their classes.

Package Name Contents of the package

[Link] Langauge support [Link] include classes for


primitive types, strings, math functions ,thread and
execeptions.
[Link] Language utility classes such as vectors, hash tables,
random numbers, data, etc.
[Link] Input/Output support classes. They provide facilities or
the input and output of data.
[Link] Classes for networking. They include classesfor
communicating with local computers as well as internet
servers
[Link] Set of classes for implementing graphical user interface.
They include classes for windows, buttons, lists,menus and
so on.
[Link] Classes forcreating and implementing applets.

Sample Code:
// Java program to convert from
// rupee to the dollar and vice-versa
// using Java Swing

import [Link].*;
Pune District Education Association’s

INSTITUTE OF TECHNOLOGY, Hadapsar.

import [Link].*;
import [Link].*;
public class GFG {

// Function to convert from rupee


// to the dollar and vice-versa
// using Java Swing
public static void converter()
{

// Creating a new frame using JFrame


JFrame f = new JFrame("CONVERTER");

// Creating two labels


JLabel l1, l2;

// Creating two text fields.


// One for rupee and one for
// the dollar
JTextField t1, t2;
Pune District Education Association’s

INSTITUTE OF TECHNOLOGY, Hadapsar.

// Creating three buttons


JButton b1, b2, b3;

// Naming the labels and setting


// the bounds for the labels
l1 = new JLabel("Rupees:");
[Link](20, 40, 60, 30);
l2 = new JLabel("Dollars:");
[Link](170, 40, 60, 30);

// Initializing the text fields with


// 0 by default and setting the
// bounds for the text fields
t1 = new JTextField("0");
[Link](80, 40, 50, 30);
t2 = new JTextField("0");
[Link](240, 40, 50, 30);

// Creating a button for INR,


// one button for the dollar
// and one button to close
Pune District Education Association’s

INSTITUTE OF TECHNOLOGY, Hadapsar.

// and setting the bounds


b1 = new JButton("INR");
[Link](50, 80, 60, 15);
b2 = new JButton("Dollar");
[Link](190, 80, 60, 15);
b3 = new JButton("close");
[Link](150, 150, 60, 30);

// Adding action listener


[Link](new ActionListener() {
public void actionPerformed(ActionEvent e)
{
// Converting to double
double d
= [Link]([Link]());

// Converting rupees to dollars


double d1 = (d / 65.25);

// Getting the string value of the


// calculated value
Pune District Education Association’s

INSTITUTE OF TECHNOLOGY, Hadapsar.

String str1 = [Link](d1);

// Placing it in the text box


[Link](str1);
}
});

// Adding action listener


[Link](new ActionListener() {
public void actionPerformed(ActionEvent e)
{
// Converting to double
double d2
= [Link]([Link]());

// converting Dollars to rupees


double d3 = (d2 * 65.25);

// Getting the string value of the


// calculated value
String str2 = [Link](d3);
Pune District Education Association’s

INSTITUTE OF TECHNOLOGY, Hadapsar.

// Placing it in the text box


[Link](str2);
}
});

// Action listener to close the form


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

// Default method for closing the frame


[Link](new WindowAdapter() {
public void windowClosing(WindowEvent e)
{
[Link](0);
}
});
Pune District Education Association’s

INSTITUTE OF TECHNOLOGY, Hadapsar.

// Adding the created objects


// to the form
[Link](l1);
[Link](t1);
[Link](l2);
[Link](t2);
[Link](b1);
[Link](b2);
[Link](b3);

[Link](null);
[Link](400, 300);
[Link](true);
}

// Driver code
public static void main(String args[])
{
converter();
}
Pune District Education Association’s

INSTITUTE OF TECHNOLOGY, Hadapsar.

Screenshots/Output:
1. The window displayed on running the program:

2. Converting from INR to the Dollar, i.e., when INR button is clicked:
Pune District Education Association’s

INSTITUTE OF TECHNOLOGY, Hadapsar.

3. Converting from the Dollar to INR, i.e., when the dollar button is clicked:

Project Implementation:
There are around 200+ different currencies used in different countries around
the world. Conversion from one currency to another is a very important
endeavor especially when it comes to marketing and travel. Currency
conversion system is implemented to reduce human power to automatically
recognize the amount monetary value of currency and convert it into the other
currencies without human supervision. The software interface that we are
proposing here could be used for various currencies.

Advantages:
 It can be Used Anywhere. Traders who send money overseas can immensely
benefit from this tool.
 It is Easy to Use.
 Offers Speedy Operations. ...
Pune District Education Association’s

INSTITUTE OF TECHNOLOGY, Hadapsar.

 It is Reliable. ...
 It Can Be Used In Import/Export Business. ...
 It is Efficient.

Disadvantages
 Uncertainty: The very fact that currencies change in value from day to day
introduces a large element of uncertainty into trade.
 Lack of Investment.
 Speculation.
 Lack of Discipline.

Conclusion:
Although foreign exchange may be confusing, in today’s global marketplace,
there is a critical need for almost everyone to understand foreign exchange like
never before. As the world shrinks, there is an ever-increasing likelihood that
we will be required to address the risks associated with the fact that there are
different currencies used all around the world and that these currencies will
have an immediate impact on our world. We must be able to evaluate the
effects of, and actively respond to, changes in exchange rates with respect to
our consumption decisions, investment portfolios, business plans, government
policies, and other life choices (both financial and otherwise).

You might also like