create a class " DistanceConverter" that converts kilometer distances to miles. Ask the users how many kilometer distance they want to convert. Create an array using the size obtained from the user. You need to create the following methods : populate Kilometers: takes the kilometers array as input and populates the array by asking the user for input. convertToMiles: takes the kilometer array as input , converts the kilometers in the array to miles, stores the miles into a new array, and then returns themiles array display Distances: takes the kilometers array and miles array as input and display the contents. It should display the kilometer distance first in one line, and then display the miles distance on the following line. make sure to annotate the output. Miles = Kilometers X 0.6214
Oh no! Our experts couldn't answer your question.
Don't worry! We won't leave you hanging. Plus, we're giving you back one question for the inconvenience.
create a class " DistanceConverter" that converts kilometer distances to miles. Ask the users how many kilometer distance they want to convert. Create an array using the size obtained from the user. You need to create the following methods :
populate Kilometers: takes the kilometers array as input and populates the array by asking the user for input.
convertToMiles: takes the kilometer array as input , converts the kilometers in the array to miles, stores the miles into a new array, and then returns themiles array
display Distances: takes the kilometers array and miles array as input and display the contents. It should display the kilometer distance first in one line, and then display the miles distance on the following line. make sure to annotate the output.
Miles = Kilometers X 0.6214