Develop a java application to implement currency converter (Dollar to INR, EURO to INR, Yen to INR and vice versa), distance converter (meter to KM, miles to KM and vice versa), time converter (hours to minutes, seconds and vice versa) using packages.
*/
package converters;
/*
Todays rate
1 DOLLAR = 68.84 INR
1 EURO = 80.90 INR
1 YEN = 0.62 INR
*/
// currency.java
import java.io.*;
import java.util.*;
public class currency
{
int type;
double DOLLAR, YEN, EURO, INR ;
double Val;
Scanner s = new Scanner(System.in);
public void fnRead()
{
System.out.println(“Enter type of Denomination : “);
System.out.println(“1 : DOLLAR”);
System.out.println(“2 : EURO”);
System.out.println(“3 : YEN”);
System.out.println(“4 : INR”);
System.out.print(“Enter option : “);
type = Integer.parseInt(s.nextLine().trim());
System.out.print(“Enter number of denominations to be converted : “);
Val = Double.parseDouble(s.nextLine().trim());
}
public void fnConvert()
{
System.out.println(“Currency conversion : “);
switch(type)
{
case 1: INR = Val * 68.84;
System.out.println(“Dollar = “+Val);
System.out.println(“INR = “+INR);
break;
case 2: INR = Val * 80.90;
System.out.println(“EURO = “+Val);
System.out.println(“INR = “+INR);
break;
case 3: INR = Val * 0.62;
System.out.println(“YEN = “+Val);
System.out.println(“INR = “+INR);
break;
case 4: DOLLAR = Val / 68.84;
EURO = Val / 80.90;
YEN = Val / 0.62;
System.out.println(“INR = “+Val);
System.out.println(“Dollar = “+DOLLAR);
System.out.println(“EURO = “+EURO);
System.out.println(“YEN = “+YEN);
break;
}
}
}
// distance.java
package converters;
/*
1 KM = 1000 METERS
1 KM = 0.621371 MILES
*/
import java.io.*;
import java.util.*;
public class distance
{
int type;
double METER, KM, MILES ;
double Val;
Scanner s = new Scanner(System.in);
public void fnRead()
{
System.out.println(“Enter type : “);
System.out.println(“1 : METER”);
System.out.println(“2 : MILES”);
System.out.println(“3 : KM”);
System.out.print(“Enter option : “);
type = Integer.parseInt(s.nextLine().trim());
System.out.print(“Enter Value to be converted : “);