AJP Microproject (Prajwal)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

GOVERNMENT POLYTECHNIC,

NANDED
Information Technology
DepartmentAcademic year: 2023-
24

Microproject on

Currency Converter

Program Name: Information Technology


Program Code: IF5I
Course Name: Advanced Java Programming

Code: 22517

Name of Students Guided By


1. Prajwal Bhalerao S.G.Munde

1|P a ge
MAHARASHTRA STATE
BOARD OF TECHNICAL EDUCATION

Certificate

This is to certify that Mr. PRAJWAL BHALERAO Roll No. 1540 of 5th
Semester of Diploma in Information technology of Institute,
GOVERNMENT POLYTECHNIC, NANDED (0020) has completed the
Micro Project satisfactorily in Subject- AJP for the academic year
2023-24 as prescribed in the curriculum.

Place : Nanded
Date :
Exam Seat No.: 358122

Subject Teacher Head of the Department Principal

S.G. Munde Prof.S.N.Dhole Dr.N.L.Janrao

2|P a ge
ANEEXURE l
Evaluation Sheet for the Micro Project
Academic Year: 2023-24. Name of the Faculty: S.G. Munde
Course: AJP Course Code: 22517 Semester: V
Title of the Project: Currency Converter

Cos address by Micro Project:


A: Develops programs using GUI Framework(AWT & Swing).
B: Handle events of AWT and Swing components.
C: Develop programs to handle events in Java programming.

Major learning outcomes achieved by the students by doing the project.

(A)Practical outcome:
1) WAP to demonstrate use of components like
Label,TextField,TextArea,Button,Checkbox,RadioButton.
2)WAP to design a form using the components List and Choice .

(B) Unit outcomes in Cognitive domain.


1) Develop GUI programs using AWT components for given problem.
2) Create Frame window with specified AWT components.
3) Develop GUI programs using AWT components for given problem.
4) Use delegation event model to develop event driven program for the given problem

Comment /suggestions about team work/leadership/inter-personal communication


(if any)
………………………………………………………………………………………………

Roll Student Name Marks out of 6 for Marks out of 4 for Total out
No. performance in group performance in of 10
activity oral/presentation
(D5 Col.8) (D5 Col.9)

1541 PRAJWAL BHALERAO

(Signature of Faculty)

3|P a ge
WEEKLY PROGRESS REPORT
Currency Converter

WEEK ACTIVITY PERFORMED DATE SIGN OF


GUIDE

1st Discussion and finalization of Topic


2ND Discussion and finalization of Topic
3RD Preparation and submission of Abstract
4TH Literature Review
5TH Collection of Data
6TH Collection of Data
7TH Collection of Data
8TH Collection of Data
9TH Discussion and Outline of Content
10TH Formulation of Content
11TH Editing and 1st proof Reading of Content
12TH Editing and 2nd proof Reading of Content
13TH Compilation of Report and Presentation
14TH Seminar
15TH Viva-voce
16TH Final submission of Micro project

Sign of the Students Sign of the Faculty

1540-

4|P a ge
CONTENTS

Sr. Title Page No.


No.
1 INTRODUCTION 06
2 PROGRAM 07 to 10
3 OUTPUT 11
4 REFERENCES & SOURCE USED 12

5|P a ge
INTRODUCTION:

A Currency Converter is a practical and indispensable tool


in today's interconnected world. It serves as a bridge
between different currencies, allowing users to understand
the value of their money in foreign lands. Whether you're a
traveler, a global investor, a business operator, or simply
someone curious about the dynamics of currency exchange,
a currency converter is your trusted companion.

This versatile tool provides real-time information on


exchange rates, enabling users to effortlessly convert one
currency into another. It empowers international travelers
to budget effectively, assists financial professionals in
making informed decisions, and aids businesses in
navigating the complexities of cross-border transactions.
With a user-friendly interface and up-to-the-minute data,
currency converters are a reliable resource for anyone
seeking to navigate the intricacies of global finance.

6|P a ge
Program:
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DecimalFormat;

public class CurrencyConverter {


private JFrame frame;
private JTextField amountField;
private JComboBox<String> fromCurrencyComboBox;
private JComboBox<String> toCurrencyComboBox;
private JLabel resultLabel;

public CurrencyConverter() {
frame = new JFrame("Currency Converter");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400, 200);

JPanel panel = new JPanel(new GridBagLayout());


GridBagConstraints gbc = new GridBagConstraints();

JLabel amountLabel = new JLabel("Amount:");


gbc.gridx = 0;
gbc.gridy = 0;
panel.add(amountLabel, gbc);

amountField = new JTextField(10);


gbc.gridx = 1;
panel.add(amountField, gbc);

String[] currencies = {"USD", "EUR", "JPY"};


fromCurrencyComboBox = new JComboBox<>(currencies);
gbc.gridx = 2;
panel.add(fromCurrencyComboBox, gbc);

JLabel toLabel = new JLabel("to");


gbc.gridx = 3;
panel.add(toLabel, gbc);

toCurrencyComboBox = new JComboBox<>(currencies);


gbc.gridx = 4;
panel.add(toCurrencyComboBox, gbc);

7|P a ge
JButton convertButton = new JButton("Convert");
gbc.gridx = 5;
panel.add(convertButton, gbc);

resultLabel = new JLabel("Result: ");


gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 6;
panel.add(resultLabel, gbc);

convertButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
convertCurrency();
}
});

frame.add(panel);
frame.setVisible(true);
}

private void convertCurrency() {


try {
double amount = Double.parseDouble(amountField.getText());
String fromCurrency =
fromCurrencyComboBox.getSelectedItem().toString();
String toCurrency =
toCurrencyComboBox.getSelectedItem().toString();

double conversionRate = getConversionRate(fromCurrency,


toCurrency);
double convertedAmount = amount * conversionRate;

DecimalFormat df = new DecimalFormat("#.##");


resultLabel.setText("Result: " + df.format(amount) + " " +
fromCurrency + " = " + df.format(convertedAmount) + " " + toCurrency);
} catch (NumberFormatException ex) {
resultLabel.setText("Invalid input. Please enter a number.");
}
}

private double getConversionRate(String fromCurrency, String toCurrency)


{

if (fromCurrency.equals("USD") && toCurrency.equals("EUR")) {

8|P a ge
return 0.85;
} else if (fromCurrency.equals("USD") && toCurrency.equals("JPY")) {
return 110.0;
} else if (fromCurrency.equals("EUR") && toCurrency.equals("USD")) {
return 1.18;
} else if (fromCurrency.equals("EUR") && toCurrency.equals("JPY")) {
return 130.0;
} else if (fromCurrency.equals("JPY") && toCurrency.equals("USD")) {
return 0.0091;
} else if (fromCurrency.equals("JPY") && toCurrency.equals("EUR")) {
return 0.0077;
}
return 1.0;
}

public static void main(String[] args) {


SwingUtilities.invokeLater(new Runnable() {
public void run() {
new CurrencyConverter();
}
});
}
}

9|P a ge
Output:

10 | P a g e
11 | P a g e
References:

https://www.tutorialspoint.com/
https://www.geeksforgeeks.org/
https://www.javatpoint.com/

Sources used:

(1) Laptop
(2) Mobile
(3) Internet
(4) Reference Book

12 | P a g e

You might also like