Reference no: EM131444731
Programming Project Assignment
Write a JAVA program to solve the following problem. Your program should properly compile and run. Your code MUST follow the documentation style used in your textbook. You need to upload into Moodle the following:
• From this point on, each of your projects is expected to be composed of multiple source code files. Thus to organize these files, all of them have to be part of a single package. Your package name MUST match the directory containing your code files. Finally, you need to export your package as a .JAR file then upload this single file into Moodle. If you are not familiar with how to export your code into a .JAR file, please check the following link. Make sure that you include your source code files (check the appropriate check box) while exporting the .jar file. https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks
%2Ftasks-33.htm
Very Important Note: Do NOT upload any other files into Moodle; just ONE file with the extension ".jar" that is it.
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].
@param x array whose largest value is found
@param start first subscript in range
@param last last subscript in range
@return the largest value of x[start] through x[last]
@pre 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 <last; i++) {
if (x[i] >maxSoFar) maxSoFar = i;
}
return maxSoFar;
}
Please do the following in this order:
1. In your code, you also need to include a brief description of your debugging plan as a series of comments that proceeds the methoddefinition.
2. In order to properly debug the given method, you need to make sure that you have several print statements at various execution phases to ensure a better insight of how the given code work. After finishing the debugging the method and fixing the problem, you need to leave ALL debugging statements in, but execute them only when the global constant TESTING istrue.
3. Before uploading your code. Make sure that it works properly for ANY combinations of input parameters and for all boundaryconditions.
Confidence interval for the population proportion
: Construct a 99% confidence interval for the population proportion of employed individuals who work at home at least once per week.
|
Which model has smallest root mean squared forecast error
: In this exercise you will compute pseudo out-of-sample two-quarter-ahead forecasts for ?Y beginning in 1989:4 through the end of the sample. (That is, you will compute).
|
Compute the current yield and capital gains yield
: Quiver Archery’s bond currently is selling for $1,065; its value one year ago was $990. The bond has a $1,000 maturity value and a coupon rate equal to 7% and it matures in 8 years. Interest is paid annually. Compute the current yield and capital gai..
|
Reflect on the practicum project goal and objectives
: With a clear conception of her Practicum Project goal and objectives, Sandra was optimistic that she was on the right track. Then she started to consider the methodology for her project and realized how much she still needed to figure out. She beg..
|
Write a test driver class that will test the method
: 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.
|
Find the probability that the number that consider
: 55% of men consider themselves baseball fans. Randomly select 10 men and ask each if he considers himself a professional fan. Find the probability that the number that consider themselves professional fans are (a) exactly 5, (b) at least 6, (c) ..
|
How much should the stock price change
: Consider a firm that had been priced using a 12.5 percent growth rate and a 14.5 percent required return. The firm recently paid a $1.65 dividend. The firm has just announced that because of a new joint venture, it will likely grow at a 13.0 percent ..
|
Essence of the operations research approach
: Model building is the essence of the operations research approach
|
What is the worth of the bond
: Rockne, Inc., has outstanding bonds that will mature in six years and pay an 8 percent coupon semiannually. If you paid $1,052.57 today and your required rate of return was 6.29 percent. What is the worth of the bond?
|