Write a test driver class that will test the method

Assignment Help JAVA Programming
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.

Reference no: EM131444731

Questions Cloud

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?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd