Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pls I need help 3 Find/FindAgain 20 marks In this problem, you will be creating black-box test cases for the static methods in the Find

image text in transcribed
image text in transcribed
image text in transcribedPls I need help
3 Find/FindAgain 20 marks In this problem, you will be creating black-box test cases for the static methods in the Find and FindAgain classes from Assignment 1. For this assignment, howver, both methods (LocateSequence ) and locateAllSequenceLocations()) will be in a modified Find class to simplify things. The AP for the two methods is shown later in this document. You will complete the makeTestCases0 method in the TestFind class. /Generate test cases for the (modified) Find class. * Oreturn an array of test cases for the (modified) Find class. public static FindTestCase[ makeTestCasesof... Each of the FindTestCase objects is a test case for both methods. A test case will consist of a target sequence, an array and the expected output for both methods. A test case is valid if it is correct for both methods. All valid test cases will be used to try and expose bugs in various implementations of each of the methods. Test cases that are invalid will be discarded. COMP1406- Winter 2019 package compl4U6as public class Findt * Finds the last occurrence of the target sequence in the array or * indicates that the target sequence is not present. *Oparam target is an array of one or more integers. It is the target sequence we are looking for. Oparam array is an array of zero or more integers. * Greturn the starting index position of the last occurrence of the target sequence in the array if it exists. Returns-1 otherwise. public static int locateSequence(int target, intO array) ...) /** Finds ALL occurrences of the target sequence in the array and returns an array indicating ho many times the target sequence appeared * in the array and all of their starting position (in increasing order) * Oparam target is an array of one or more integers. It is the target sequence we are looking for. * Oparam array is an array of zero or more integers. * Greturn an array of integers of size at least one. The first elecent * Oparam array is an array of zero or more integers. * Greturn the starting index position of the last occurrence of the target sequence in the array if it exists. Returns -1 othervise. public static int locateSequence (int target, int array)...) / Finds ALL occurrences of the target sequence in the array and * returns an array indicating how many times the target sequence appeared * in the array and all of their starting position (in increasing order) * Oparam target is an array of one or more integers. It is the target sequence we are looking for. * Oparan array is an array of zero or more integers. Oreturn an array of integera of size at least one. The first element in the array is the number of times the target sequence vas found in the array. The next elements, if any, are the starting index positions of each occurrence of the target sequence in the array listed in increasing order. The returned array should be big enough to hold this data and not any larger. public static int[] locateAl1SequenceLocations(int target, intl] array) ...) 3 Find/FindAgain 20 marks In this problem, you will be creating black-box test cases for the static methods in the Find and FindAgain classes from Assignment 1. For this assignment, howver, both methods (LocateSequence ) and locateAllSequenceLocations()) will be in a modified Find class to simplify things. The AP for the two methods is shown later in this document. You will complete the makeTestCases0 method in the TestFind class. /Generate test cases for the (modified) Find class. * Oreturn an array of test cases for the (modified) Find class. public static FindTestCase[ makeTestCasesof... Each of the FindTestCase objects is a test case for both methods. A test case will consist of a target sequence, an array and the expected output for both methods. A test case is valid if it is correct for both methods. All valid test cases will be used to try and expose bugs in various implementations of each of the methods. Test cases that are invalid will be discarded. COMP1406- Winter 2019 package compl4U6as public class Findt * Finds the last occurrence of the target sequence in the array or * indicates that the target sequence is not present. *Oparam target is an array of one or more integers. It is the target sequence we are looking for. Oparam array is an array of zero or more integers. * Greturn the starting index position of the last occurrence of the target sequence in the array if it exists. Returns-1 otherwise. public static int locateSequence(int target, intO array) ...) /** Finds ALL occurrences of the target sequence in the array and returns an array indicating ho many times the target sequence appeared * in the array and all of their starting position (in increasing order) * Oparam target is an array of one or more integers. It is the target sequence we are looking for. * Oparam array is an array of zero or more integers. * Greturn an array of integers of size at least one. The first elecent * Oparam array is an array of zero or more integers. * Greturn the starting index position of the last occurrence of the target sequence in the array if it exists. Returns -1 othervise. public static int locateSequence (int target, int array)...) / Finds ALL occurrences of the target sequence in the array and * returns an array indicating how many times the target sequence appeared * in the array and all of their starting position (in increasing order) * Oparam target is an array of one or more integers. It is the target sequence we are looking for. * Oparan array is an array of zero or more integers. Oreturn an array of integera of size at least one. The first element in the array is the number of times the target sequence vas found in the array. The next elements, if any, are the starting index positions of each occurrence of the target sequence in the array listed in increasing order. The returned array should be big enough to hold this data and not any larger. public static int[] locateAl1SequenceLocations(int target, intl] array) ...)

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

Decisions Based On Data Analytics For Business Excellence

Authors: Bastian Weber

1st Edition

9358681683, 978-9358681680

More Books

Students also viewed these Databases questions