Ajp Microproject
Ajp Microproject
ON
“Currency Converter”
Submitted By
1. Shahane Pranav
Guided By
TO
VISHNUPURI, NANDED-431606
PROJECT REPORT
ON
“Currency Converter”
SUBMITTED BY
1. Shahane Pranav
GUIDED BY
VISHNUPURI, NANDED431606
2
AJP(22517) Currency Converter
CERTIFICATE
“Currency Converter”
Principal 3
AJP(22517) Currency Converter
ACKNOWLEDGEMENT
Sincerely:
1. Shahane Pranav
4
AJP(22517) Currency Converter
5
AJP(22517) Currency Converter
बनणे.
6
AJP(22517) Currency Converter
ANNUEXURE II
7
AJP(22517) Currency Converter
Index
Sr. No Contents Page No.
Introduction 1
1
2 Need Of Currenct Converter 2-3
5 Program 10-11
7 Applications 15
8 Conclusion 16
9 Reference 17
8
AJP(22517) Currency Convert
This Java currency converter project offers a streamlined solution for converting
between major currencies. Leveraging Java's functionality, users can input an
amount in USD or INR and select their desired currency for conversion,
including EUR, GBP, and INR. Through this project, we'll explore fundamental
programming concepts while providing a practical tool for currency conversion.
Let's embark on this journey to build a versatile and efficient currency converter
in Java.
In today's globalized world, where people travel, trade, and conduct business
internationally, the need for a currency converter is paramount. Here's why:
• Travel :
1
AJP(22517) Currency Convert
When traveling to different countries, it's essential to understand the value of your
money in the local currency. A currency converter helps travelers budget
effectively and make informed purchasing decisions.
• International Trade :
• Financial Transactions :
With the rise of e-commerce and online transactions, individuals often purchase
goods and services from foreign websites. A currency converter facilitates
seamless transactions by displaying prices in the user's preferred currency.
• Investments :
• Forex Trading :
2
AJP(22517) Currency Convert
Currency traders rely on real-time exchange rates to buy and sell currencies
for profit. A currency converter provides valuable insights and helps traders
make informed decisions in the volatile foreign exchange market.
• Remittances :
Migrant workers frequently send money back home to their families. A currency
converter ensures that recipients receive the correct amount of money after
currency conversion, minimizing losses due to unfavorable exchange rates.
Operations Performed:
3
AJP(22517) Currency Convert
The currency converter should accept user input for the amount to be converted
and the currencies involved.
2. Conversions Rates :
The converter needs conversion rates between different currencies. These rates
are predefined or fetched from an external source like an API.
3. Perform Conversions :
Based on the user input and conversion rates, the converter calculates the
equivalent amount in the desired currency.
4. Display Result :
Implementation Details
4
AJP(22517) Currency Convert
• Use the CurrencyConverterSwing class to accept user input from the user.
• Prompt the user to enter the amount to convert and the currency to convert
from
2. Conversion Rates :
3. Perform Conversions :
5
AJP(22517) Currency Convert
5. Display Results :
6
AJP(22517) Currency Convert
// Declare JTextField components to accept user input for amount and fromCurrency
private JTextField fromCurrencyField; // For accepting the source currency (USD, EUR,
GBP, INR)
convertButton.addActionListener(new ActionListener() {
try {
7
AJP(22517) Currency Convert
});//
Conversion Rates
8
AJP(22517) Currency Convert
9
AJP(22517) Currency Convert
10
AJP(22517) Currency Convert
Display Results
Breakdown:
resultLabel: This is a JLabel that is used to display the conversion results on the
GUI. Initially, it's set to a placeholder text ("Converted Amounts will be displayed
here").
Updating JLabel: After the conversion is complete, the setText() method is called
to update the label with the conversion results. The conversion results are
formatted as HTML (<html> and </html> tags) so that the amounts for EUR,
GBP, and INR appear on separate lines.
11
AJP(22517) Currency Convert
Code :
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
return usdToEur;
return usdToGbp;
return usdToInr;
12
AJP(22517) Currency Convert
switch (fromCurrency) {
case "USD":
return amount;
case "EUR":
case "GBP":
case "INR":
default:
switch (toCurrency) {
case "USD":
return amount;
case "EUR":
case "GBP":
case "INR":
13
AJP(22517) Currency Convert
default:
public CurrencyConverterService() {
14
AJP(22517) Currency Convert
SwingUtilities.invokeLater(() -> {
try {
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
public CurrencyConverterSwing() {
initialize();
15
AJP(22517) Currency Convert
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout
// Title label
frame.getContentPane().add(titleLabel);
frame.getContentPane().add(amountLabel);
frame.getContentPane().add(amountField);
frame.getContentPane().add(fromCurrencyLabel);
frame.getContentPane().add(fromCurrencyField);
// Convert button
16
AJP(22517) Currency Convert
frame.getContentPane().add(convertButton);
// Result label
frame.getContentPane().add(resultLabel);
convertButton.addActionListener(new ActionListener() {
try {
});
17
AJP(22517) Currency Convert
OUTPUT :
18
AJP(22517) Currency Convert
Advantages
19
AJP(22517) Currency Convert
Disadvantages
20
AJP(22517) Currency Convert
Application
1. Travel Planning.
2. International Trade.
3. Financial Management.
4. E-Commerce.
5. Remittances.
6. Financial Education.
7. Investment analysis.
21
AJP(22517) Currency Convert
Conclusion
In Conclusion , currency converters are essential tools that enable quick and
accurate conversion between different currencies. They find applications in
travel, international trade, financial management, e-commerce, remittances,
education, investment analysis, and business expense management. Despite
their benefits, users should be aware of potential limitations and risks
associated with exchange rate variability, hidden fees, security concerns,
and regulatory challenges. Overall, currency converters play a crucial role
in promoting global connectivity, financial transparency, and economic
efficiency.
22
AJP(22517) Currency Convert
References
• https://chat.openai.com/c/194ff79c-f0f1-44e9-90a7-2c1456d4b922
• https://m.youtube.com
• https://www.jobrunr.io/en/blog/2023-02-13-currency-converter/
23