Question: Part One Write a test program to test all of the methods in a class. Create a new project in Eclipse called P12. Download the

Part One

Write a test program to test all of the methods in a class.

Create a new project in Eclipse called P12.

Download the Java archive TestClass.jar.

Import the TestClass.jar file using Build Path->Add External Archive

Copy the interface file TestInterface.java to the P12/src directory.

Create a new class called P12 with a main method.

Instantiate TestClass in the main method using the TestInterface, as follows:

 // Instantiate test class TestInterface inter = new TestClass(); 

Write code to test each of the six methods in the TestClass.

Each method in TestClass has two distinct defects, so find them!

Interface

The following is the interface that you are testing. Pay careful attention to parameters and return values, and the description of the functionality. The testing program will ignore all of your output from System.out, so you can print whatever you would like.

// P12 Interface File public interface TestInterface { // Returns a reversed version of the specified string, // which can contain any ASCII character. // For example, returns "edcba" for "abcde" public String reverseString(String s); // Returns the specified string duplicated. // For example, returns "Hello There!Hello There!" for "Hello There!" public String duplicateString(String s); // Creates an array of strings with // [0] = original, [1] = toUppercase(), [2] = toLowercase(). // For example, returns {"Whatever", "WHATEVER", "whatever"} for "Whatever" public String[] createStrings(String s); // Cubes all elements in array of doubles. // For example, changes {2.0, 3.0, 4.0} to {8.0, 27.0, 64.0} public void cubeArray(double[] array); // Adds the elements in array of integers, // returning the sum as an integer. // For example, returns 21 for {1, 2, 3, 4, 5, 6} public int sumArray(int[] array); // Sorts an array of integers from low to high. // For example, changes {2, 6, 4, 9, 1} to {1, 2, 4, 6, 9} public void sortArray(int[] array); 

}

This with using Eclipse and with JAVA Programming!

https://www.cs.colostate.edu/~cs160/.Spring16/assignments/P12.html

here is the website if you need to download the Jar file and java.

Please help me to get P12.java Thank you so much!

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 Databases Questions!