//Complete the code In a class called DistanceConverter, the…
Questions
//Cоmplete the cоde In а clаss cаlled DistanceCоnverter, there is a method that converts distances from kilometers to miles, public double convert(double km) { return km * 0.621371; } This method converts a single distance from kilometers to miles with the formula: miles = km * 0.621371 Add an overloaded method:public double[] convert(double[] kmValues){ }This method should convert an array of distances from kilometers to miles and returns a new array with the results. In the Testmain class: Create an object of DistanceConverter.Call convert(double) with a single value.Call convert(double[]) with an array of distances.Display both results. Sample Input and Output: Single distance: 5 km = 3.106855 milesArray distances: {1, 10, 42} km ={0.621371, 6.21371, 26.097582} miles