0% found this document useful (0 votes)
5 views1 page

Currency Converter

The document contains a Java class named CurrencyConverter that provides methods for converting between different currencies, including dollars, rupees, euros, and yen. Each method takes an amount in one currency and prints the equivalent amount in another currency using predefined conversion rates. The class includes methods for both direct and reverse conversions for each currency pair.

Uploaded by

kumbharakash208
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Currency Converter

The document contains a Java class named CurrencyConverter that provides methods for converting between different currencies, including dollars, rupees, euros, and yen. Each method takes an amount in one currency and prints the equivalent amount in another currency using predefined conversion rates. The class includes methods for both direct and reverse conversions for each currency pair.

Uploaded by

kumbharakash208
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

package Converter;

public class CurrencyConverter {


public void dollarToRupee(float dollar) {
System.out.printf("%.2f dollars is equal to %.2f rupees\n", dollar,
dollar*82.35f);
}
public void rupeeToDollar(int rupee) {
System.out.printf("%d rupees is equal to %.2f dollars\n", rupee,
rupee/82.35f);
}
public void euroToRupee(float euro) {
System.out.printf("%.2f euros is equal to %.2f rupees\n", euro,
euro*87.93f);
}
public void rupeeToEuro(int rupee) {
System.out.printf("%d rupees is equal to %.2f euros\n", rupee,
rupee/87.93f);
}
public void yenToRupee(int yen) {
System.out.printf("%d yens is equal to %.2f rupees\n", yen, yen/0.62f);
}
public void rupeeToYen(int rupee) {
System.out.printf("%d rupees is equal to %.2f yens\n", rupee, rupee*0.62f);
}
}

You might also like