Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Android Graphics

Authors: Wallace Jackson

1st Edition

1430257857, 978-1430257851

More Books

Students also viewed these Programming questions

Question

Describe Descartess views about reflex activity.

Answered: 1 week ago

Question

b. What is the probability that the family has four children?

Answered: 1 week ago