Write a program to convert length from one unit to another. Use only Inches, Centimeters, Feet, Meters, Kilometers, Miles for conversion and round off the result to two decimals. Return -1 if conversion is not possible. 1 feet=30.48 cms, 1 mt=3.2808 foot, 1 mile=1.6093 km.
Input (double, String, String) |
Output (double) |
2.23, Kilometers, Centimeters |
223000.0 |
21.65, Inches, Meters |
0.55 |
68.5, Meters, Feet |
224.74 |
56.22, Acre, Meters |
-1.0 |
6.5, Foot, Centimeters |
198.12 |
86.4, Meters, Miles |
0.05 |