Respuesta :

Answer:

A stub method or merely a stub in software development is a code piece that performs various other programming functionality. It can copy the existing code behavior like a procedure on a remote machine like methods are quite frequently known as mocks or for a while working for a code that has not yet been developed.

Please check the explanation for more details.

Explanation:

A method stub in this intelligence is a method with no factual material, i.e. it's not deed what it is intended to do. Your getUserNum() method must return a user's unique ID, but in its place, you're indispensable a stub that merely returns -1 on every request.

Through the main method, you should define these methods:

Num1=getUserNum();

Num2=getUserNum();

avgResult = computeAvg(Num1, Num2);

Hence, define them. And below is how the above stub function should be like:

public static int getUserNum(){

System.out.println("FIXMR:Finish getUserNum()");

return -1;

And the whole program should look like:

import java.util.Scanner;

public class Main {

public static int getUserNum ()

{

System.out.println("FIXME: Finish getUserNum()");

return -1;

}

public static int computeAvg(int Num1, int Num2)

{

int avgResult = (Num1 + Num2)/2;

System.out.println("FIXME: Finish computeAvg()"); return -1;

}

public static void main(String[] args)

{

int Num1 = 0;

int Num2 = 0;

int avgResult = 0;

Num1 = getUserNum(); Num2 = getUserNum();

avgResult = computeAvg(Num1, Num2);

System.out.println("Avg: " + avgResult);

return;

}

}