1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
shtirl [24]
2 years ago
7

Define stubs for the functions called by the below main(). Each stub should print "FIXME: Finish FunctionName()" followed by a n

ewline, and should return -1.
Computers and Technology
1 answer:
joja [24]2 years ago
3 0

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;

}

}

You might be interested in
Click this link to view O*NET’s Tasks section for Farmworkers and Laborers, Crop.
dangina [55]

Answer:

B. operating tractors and machinery

D. maintaining vehicles and equipment

E. operating irrigation (watering) equipment

F. harvesting fruits and vegetables by hand

Explanation:

6 0
2 years ago
A list of sources used for in-text citations that appears at the end of a document is called:
jolli1 [7]
The correct answer is Works cited page
5 0
2 years ago
Name the three basic storage device of a computer​
grigory [225]
Hard disk Drive, random access memory, USB flash memory
7 0
3 years ago
Read 2 more answers
Alex has composed a layout with this Image for a magazine. Which rule of composition has Alex applied?
Genrish500 [490]

Answer:

Golden Ratio

Explanation:

7 0
3 years ago
Which is an example of analog d<br><br><br>evice​
neonofarm [45]

Answer:

crt (cathode ray tube) vcr (video cassette recorder)

Explanation:

8 0
1 year ago
Other questions:
  • What is the output after the following code executes?
    14·1 answer
  • Computer program allowing the computer to communicate<br> with a hardware device
    13·1 answer
  • A typeface in which each character has the same width and is often used to display programming code is _
    8·1 answer
  • A _________________________ can use SOAP headers to carry meta information in its messages. A. Web service B. REST Service C. Co
    14·1 answer
  • Fill in the blanks with given words:{system unit / desktop / laptop / tablet / smartphone}1. A _____ can be as powerful as a des
    11·1 answer
  • What will be the value of “sumtotal” when this code is executed?
    6·1 answer
  • this bar is located at the top of your computer school in.Its functions allow you to navigate the web​
    5·2 answers
  • 2. The<br>is the main and usually largest data storage hardware device in a computer​
    9·1 answer
  • Which popular video game franchise has released games with the subtitles World At War and Black Ops?
    10·2 answers
  • One way to check if a website is secure is to look for a/an<br> in the address bar.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!