Answered step by step
Verified Expert Solution
Question
1 Approved Answer
inputData.txt file -15 -57 -75 -93 -42 -1 -9 -63 -77 -12 please follow the directions carefully and do as stated, thanks! Problem Statement: The
inputData.txt file
-15 -57 -75 -93 -42 -1 -9 -63 -77 -12
please follow the directions carefully and do as stated, thanks!
Problem Statement: The following method does not appear to be working properly if all data are negative numbers. You are asked to write a test driver class that will test this method in order to identify the issue with the code. The driver class will first read a data (from an input file called "inputData.txt") into an integer array then call the method with different input parameters to test its functionality. Finds the target value in array elements x[start] through x[last]. 2param x array whose largest value is found 2param start first subscript in range Oparam last last subscript in range Creturn the largest value of x[start] through x[last] Opre first last public int findMax(int x, int start, int last) if (start last) throw new IllegalArgumentException ("Empty range"); int maxSoFar 0; for (int i start; i K last; i f if (x[i] maxSoFar maxSoFar i; return maxSoFarStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started