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

Ajp MP

Uploaded by

Tanmay Warthe
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)
32 views

Ajp MP

Uploaded by

Tanmay Warthe
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
You are on page 1/ 10

A Micro-Project on

CURRENCY CONVERTER USING AWT

GOVERNMENT POLYTECHNIC BRAMHAPURI


Submitted: 24-25
This micro-project work submitted in partial fulfillment ofrequirement
for award diploma in Computer Technology

Under the guidance of


Mr. A. B. RAMTAKE
(Lecturer in Computer Technology Dept.)
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION

CERTIFICATION
This is to certify that the following students of this Institute have carried Out this
micro-project work on “CURRENCY CONVERTER USING AWT” under the
guidance of Mr. A. B. RAMTAKE in the Diploma Engineering During the
session 2024-2025. This work Has been done in the partial fulfillment of the
award for in Computer Engineering from Maharashtra State Board of Technical
Education, Mumbai.

SUBMITTED-BY
Name Enrollment No. Roll No.
Tanmay M. Warthe 2201210125 22

Project Guide Head of Department


Mr. A. B. RAMTAKE Prof. S. K. Kharkate

Principal
Dr. R. J. WANKHEDE
Part - A
CURRENCY CONVERTER USING AWT

1.0 Aim :
Currency Converter using AWT

2.0 Course outcomes Achieved


1. Develop programs using GUI Framewojk (AWT and Swing).
2. Handle events of A WT and Swings components.
3. Develop programs to handle events in Java Programming.

2.0. Proposed Methodology :

• Firstly we will study about given topic.


• Then after we will study and discuss about topic with our project guide.
• After we have collected the information of our topic from internet and operating
system books
• After we have started to working of micro project.
• After execution of program firstly we will check .
• When our micro-project is ready then we submitted to our project guide.

3.0 Resources used :

Sr. Name of Specification


Resource/Material
No
1 Laptop MAC M2

2 Software Ms - Word ,Chrome Browser


4.0 Action Plan

Sr No. Details of Activity Plan start date Plan Finish date Name of responsible
group member.

1. Discuss about the topic.

2. Information search from


various sources.
Discuss with project guide Tanmay Warthe
3.
4. Implement PART-A

5. Implement PART-B

6. Corrections of report

7. Submission of Final
Report
Part B
“CURRENCY CONVERTER USING AWT”

1.0 Rational
Java technology is widely used for web applications development. Based on the object
oriented concepts and core Java concepts, this course will equip the students with the required
knowledge and skill of object oriented programming approach needed for the development of
robust, powerful web applications. Through this course studentswill get hands-on experience
on GUI Technologies viz. A WT and Swings, event handling mechanisms and network
programming. The course also gives coverage to various web applications aspects like
Database Interaction, server side components and servlets.
.
2.0 Aim of micro-project
Currency Converter using AWT

3.0 Course Outcome

1. Develop programs using GUI Framewojk (AWT and Swing).


2. Handle events of A WT and Swings components.
3. Develop programs to handle events in Java Programming.

5.0 Actual Methodology

• Firstly we will study about given topic.


• Then after we will study and discuss about topic with our project guide.
• After we have collected the information of our topic from internet and operating
system books.
• After we have started to working of micro project.
• After execution of program firstly we will check .
• When our micro-project is ready then we submitted to our project guide.
6.0 Output of the project

CODE :
import java.awt.*;
import java.awt.event.*;

public class CurrencyConverter extends Frame implements ActionListener {


private Label inputLabel, outputLabel, fromLabel, toLabel, resultLabel;
private TextField inputField;
private Choice fromCurrency, toCurrency;
private Button convertButton, clearButton;

public CurrencyConverter() {
setTitle("Currency Converter");
setSize(400, 300);
setLayout(null);

// Input Amount
inputLabel = new Label("Amount:");
inputLabel.setBounds(50, 50, 80, 30);
add(inputLabel);

inputField = new TextField();


inputField.setBounds(150, 50, 150, 30);
add(inputField);

// From Currency
fromLabel = new Label("From:");
fromLabel.setBounds(50, 100, 80, 30);
add(fromLabel);

fromCurrency = new Choice();


fromCurrency.add("USD");
fromCurrency.add("EUR");
fromCurrency.add("INR");
fromCurrency.setBounds(150, 100, 150, 30);
add(fromCurrency);

// To Currency
toLabel = new Label("To:");
toLabel.setBounds(50, 150, 80, 30);
add(toLabel);

toCurrency = new Choice();


toCurrency.add("USD");
toCurrency.add("EUR");
toCurrency.add("INR");
toCurrency.setBounds(150, 150, 150, 30);
add(toCurrency);

// Convert Button
convertButton = new Button("Convert");
convertButton.setBounds(50, 200, 100, 30);
convertButton.addActionListener(this);
add(convertButton);

// Clear Button
clearButton = new Button("Clear");
clearButton.setBounds(200, 200, 100, 30);
clearButton.addActionListener(this);
add(clearButton);

// Result Label
resultLabel = new Label("Result: ");
resultLabel.setBounds(50, 250, 300, 30);
add(resultLabel);

setVisible(true);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
System.exit(0);
}
});
}

@Override
public void actionPerformed(ActionEvent ae) {
if (ae.getSource() == convertButton) {
try {
double amount = Double.parseDouble(inputField.getText());
String from = fromCurrency.getSelectedItem();
String to = toCurrency.getSelectedItem();
double convertedAmount = convertCurrency(amount, from, to);
resultLabel.setText("Result: " + String.format("%.2f", convertedAmount) +
" " + to);
} catch (NumberFormatException e) {
resultLabel.setText("Invalid input. Please enter a valid number.");
}
} else if (ae.getSource() == clearButton) {
inputField.setText("");
resultLabel.setText("Result: ");
}
}

private double convertCurrency(double amount, String from, String to) {


// Conversion rates
double usdToInr = 83.0, eurToInr = 88.0, usdToEur = 0.94;

if (from.equals(to)) {
return amount;
}

// Convert to INR first


double inrAmount = 0;
switch (from) {
case "USD": inrAmount = amount * usdToInr; break;
case "EUR": inrAmount = amount * eurToInr; break;
case "INR": inrAmount = amount; break;
}

// Convert INR to target currency


switch (to) {
case "USD": return inrAmount / usdToInr;
case "EUR": return inrAmount / eurToInr;
case "INR": return inrAmount;
}
return 0;
}

public static void main(String[] args) {


new CurrencyConverter();
}
}

OUTPUT :
Conclusion :
The project involves a good knowledge of java programming language. The developer will
be able to implement it easily as it doesn’t require any database and the sourse code is also
available for free. This project is very affordable and useful for the people who are in
business,shares or finance. As it is a web-based program,it will update automatically

Reference :
https://www.geeksforgeeks.com/
https://www.javapoint.com/

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy