Java Final PDF
Java Final PDF
Thergaon Pune-33
V Semester
(Year: 2022-23)
Micro Project
CERTIFICATE
This is to certify that Ms. Aditi Vaibhav Apte Roll No. 200304 of Fifth
Institute Seal
Teacher Evaluation Sheet for Micro Project
Signature: _____________________________________________
Maharashtra State Board of Technical Education, Mumbai
MICRO PROJECT
Project work Report
Name of the Student: Aditi Vaibhav Apte
MICROPROJECT
Aditi Vaibhav Apte (200304)
Currency Converter
Index
Sr No Title Page No
1. Introduction 01
5. Conclusion 10
6. References 11
MM POLYTECHNIC ,PUNE
Currency Converter
Certificates
MM POLYTECHNIC ,PUNE
Currency Converter
Introduction
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 microproject project is built keeping this thing in mind. It is simply
a calculator-like app developed using Advanced Java 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 , users are provide value in rupees .This simple feature allows
users to enter amount and get Converted into Different currency like Euro , Canadian Dollar ,
Brazilian Real , United States Dollar, Swiss franc etc.
In this Currency Converter GUI is developed using AWT components are used . it is
handled using Action Event And Networking is used to perform actual conversion of currency.
MM POLYTECHNIC , PUNE 1
Currency Converter
Client provide
input to server
Server returns
the conversion
to client
MM POLYTECHNIC , PUNE 2
Currency Converter
Code of Project
Client
import java.awt.*;
import java.net.*;
import java.awt.event.*;
public class CC extends Frame implements ActionListener
{ TextField t1, t2, t3, t4, t5, t6; String input, eur ,cad , brl, usd,chf;
CC ()
{
setLayout(new FlowLayout());
Label l1 = new Label("Currency Converter");
add(l1);
Label l2 = new Label(" Enter Currency In Rupees(INR) ");
add(l2);
t1 = new TextField(20);
add(t1);
Label l3 = new Label(" Converted into Euro (EUR) ");
add(l3);
t2= new TextField(20);
add(t2);
Label l4 = new Label(" Converted into Canadian Dollar (CAD) ");
add(l4);
t3 = new TextField(20);
add(t3);
Label l5 = new Label(" Converted into Brazilian Real(BRL) ");
add(l5);
t4 = new TextField(20);
add(t4);
MM POLYTECHNIC , PUNE 3
Currency Converter
MM POLYTECHNIC , PUNE 4
Currency Converter
DatagramPacket dp = new
DatagramPacket(sendnum,sendnum.length,ip,2000);
ds.send(dp);
DatagramPacket dp1 = new DatagramPacket(receur,receur.length);
ds.receive(dp1);
eur= new String(dp1.getData(),0,dp1.getLength());
t2.setText(""+eur);
DatagramPacket dp2 = new DatagramPacket(reccad,reccad.length);
ds.receive(dp2);
cad= new String(dp2.getData(),0,dp2.getLength());
t3.setText(""+cad);
DatagramPacket dp3 = new DatagramPacket(recbrl,recbrl.length);
ds.receive(dp3);
brl= new String(dp3.getData(),0,dp3.getLength());
t4.setText(""+brl);
DatagramPacket dp4 = new DatagramPacket(recusd,recusd.length);
ds.receive(dp4);
usd = new String(dp4.getData(),0,dp4.getLength());
t5.setText(""+usd);
DatagramPacket dp5 = new DatagramPacket(recchf,recchf.length);
ds.receive(dp5);
chf=new String(dp5.getData(),0,dp5.getLength());
t6.setText(""+chf);
}
catch(Exception e){}}
}
public static void main(String args[])throws Exception
{
CC obj = new CC();
obj.setSize(300,500);
MM POLYTECHNIC , PUNE 5
Currency Converter
obj.setVisible(true);
obj.setTitle("Currency Converter");
}
}
MM POLYTECHNIC , PUNE 6
Currency Converter
Server
import java.net.*;
public class CS
{
public static void main(String args[])throws Exception
{
DatagramSocket ds = new DatagramSocket(2000);
byte[] recdnum = new byte[1024];
byte[]sendeur= new byte[1024];
byte[]sendcad= new byte[1024];
byte[]sendbrl= new byte[1024];
byte[]sendusd= new byte[1024];
byte[]sendchf= new byte[1024];
String input , S1 ,S2,S3 ,S4, S5; double value , eur , cad , brl , usd , chf ;
DatagramPacket dp = new DatagramPacket(recdnum,recdnum.length);
ds.receive(dp);
input = new String(dp.getData(), 0 ,dp.getLength());
value =Integer.parseInt(input);
InetAddress ip =InetAddress.getLocalHost();
eur = (value*0.0117570855);
S1=new String(""+eur );
sendeur=S1.getBytes();
DatagramPacket dp1 = new
DatagramPacket(sendeur,sendeur.length,ip,dp.getPort());
ds.send(dp1);
cad = (value*0.0164093503);
S2=new String(""+cad );
sendcad=S2.getBytes();
DatagramPacket dp2 = new
DatagramPacket(sendcad,sendcad.length,ip,dp.getPort());
ds.send(dp2);
MM POLYTECHNIC , PUNE 7
Currency Converter
brl = (value*0.0662422753);
S3=new String(""+brl );
sendbrl=S3.getBytes();
DatagramPacket dp3 = new
DatagramPacket(sendbrl,sendbrl.length,ip,dp.getPort());
ds.send(dp3);
usd = (value*0.0122444132);
S4=new String(""+usd );
sendusd=S4.getBytes();
DatagramPacket dp4 = new
DatagramPacket(sendusd,sendusd.length,ip,dp.getPort());
ds.send(dp4);
chf = (value*0.0115831292);
S5=new String(""+chf );
sendchf=S5.getBytes();
DatagramPacket dp5 = new
DatagramPacket(sendchf,sendchf.length,ip,dp.getPort());
ds.send(dp5);
}
}
MM POLYTECHNIC , PUNE 8
Currency Converter
MM POLYTECHNIC , PUNE 9
Currency Converter
Conclusion
MM POLYTECHNIC , PUNE 10
Currency Converter
References
https://ijarcce.com/wp-content/uploads/2021/06/IJARCCE.2021.10590.pdf
https://github.com/projectworldsofficial/currency-converter-in-java
https://www.geeksforgeeks.org/java-program-to-convert-currency-using-awt/
https://www.scaler.com/topics/currency-converter-java-project/
MM POLYTECHNIC , PUNE 11