Question: CODE SIMPLE CLASS USING JSGRASP: need: simmectrics.jar commons-codec-1.10jar guava-19.jar Write a Java class named AverageOfDistances that meets the following requirements: Create an instance of the

CODE SIMPLE CLASS USING JSGRASP:

need: simmectrics.jar

commons-codec-1.10jar

guava-19.jar

Write a Java class named AverageOfDistances that meets the following requirements:

Create an instance of the simmetrics JaroWinkler class. Use that instance to compute and print the distance between two runtime arguments. The runtime arguments are Strings that come from the args array. Label your results.

Create an instance of the simmetrics Levenshtein class. Use that instance to compute and print the distance between two runtime arguments.The runtime arguments are Strings that come from the args array. Label your results.

In requirements 1 and 2 you obtain one number each (a distance). Compute and print the average of those two distances. Label your results.

In requirements 1 and 2 you obtain one number each (a distance). Compute and print the maximum of those two distances. Label your results.

Here is sample output from my solution:

Trial #1

Using two strings: >>>this>>those

JaroWinkler: 0.17333335

Levenshtein: 2.0

Average: 1.0866667032241821

Maximum: 2.0

Trial #2

Using two strings: >>>java>>programming

JaroWinkler: 0.55303025

Levenshtein: 10.0

Average: 5.276515007019043

Maximum: 10.0

Can start with:

// You need one, and ONLY one, import statement

public class AverageOfDistances {

public static void main(String args[]) {

String a = args[0];

String b = args[1];

System.out.println("Using two strings: >>>" + a + ">>" + b + "

// Your code goes here!

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!