Ajp MP
Ajp MP
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
Principal
Dr. R. J. WANKHEDE
Part - A
CURRENCY CONVERTER USING AWT
1.0 Aim :
Currency Converter using AWT
Sr No. Details of Activity Plan start date Plan Finish date Name of responsible
group member.
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
CODE :
import java.awt.*;
import java.awt.event.*;
public CurrencyConverter() {
setTitle("Currency Converter");
setSize(400, 300);
setLayout(null);
// Input Amount
inputLabel = new Label("Amount:");
inputLabel.setBounds(50, 50, 80, 30);
add(inputLabel);
// From Currency
fromLabel = new Label("From:");
fromLabel.setBounds(50, 100, 80, 30);
add(fromLabel);
// To Currency
toLabel = new Label("To:");
toLabel.setBounds(50, 150, 80, 30);
add(toLabel);
// 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: ");
}
}
if (from.equals(to)) {
return amount;
}
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/