Write a unit conversion program that asks users to identify the unit from which they want to convert and the unit to which they want to convert. Legal units are in, ft, mi, mm, cm, m, and km. Declare two objects of a class UnitConverter that convert between meters and a given unit.

Convert from:
in
Convert to:
mm
Value:
10
10 in = 254 mm

Complete the following file:

UnitConverter.java

Use the following file:

ConversionCalculator.java

import java.util.Scanner;

/**
   This class converts between two units.
*/
public class ConversionCalculator
{
   public static void main(String[] args)
   {
      Scanner in = new Scanner(System.in);
      
      System.out.println("Convert from:");
      String fromUnit = in.nextLine();

      System.out.println("Convert to: ");
      String toUnit = in.nextLine();
      
      UnitConverter from = new UnitConverter(fromUnit);
      UnitConverter to = new UnitConverter(toUnit);

      System.out.println("Value:");
      double val = in.nextDouble();

      double meters = from.toMeters(val);
      double converted = to.fromMeters(meters);

      System.out.println(val + " " + fromUnit + " = " + converted + " " + toUnit);
   }
}