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]
3 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]3 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
What responds to both visual appeal and functional needs? (1 point) A.) applied art B.) performance art C.) fine art D.) visual
d1i1m1o1n [39]

Answer:

a

Explanation:

6 0
3 years ago
PLEASEE HELPP.... QUESTION... how does coding impact your life​
nataly862011 [7]

Answer: It allows us to do everyday tasks on the internet

Explanation: We wouldn’t be able to email, research, etc without coding!

6 0
2 years ago
Read 2 more answers
Write a statement that declares a prototype for a function printArray, which has two parameters. The first parameter is an array
Savatey [412]

Answer:

void printArray(int [],int);

Hope this helps!

4 0
2 years ago
You want to be able to access your home computer using remote desktop while traveling. you enable remote desktop, but you find t
solong [7]
Get a program for this perpose or perhaps get a new computer
5 0
2 years ago
Read 2 more answers
Explain in detail why intel 8086 segments are 64 KB in size?
gtnhenbr [62]

Answer:

Explanation:

phân đoạn bộ nhớ x86 đề cập đến việc thực hiện phân đoạn bộ nhớ trong Intel x86 máy vi tính bản hướng dẫn kiến ​​trúc. Phân đoạn đã được giới thiệu trên Intel 8086 vào năm 1978 như một cách cho phép các chương trình có địa chỉ hơn 64 KB (65,536byte) của bộ nhớ. Các Intel 80286 đã giới thiệu phiên bản thứ hai của phân đoạn vào năm 1982 bổ sung hỗ trợ cho bộ nhớ ảo và bảo vệ bộ nhớ. Tại thời điểm này, mô hình ban đầu đã được đổi tên chế độ thựcvà phiên bản mới được đặt tên chế độ bảo vệ. Các x86-64 kiến trúc, được giới thiệu vào năm 2003, phần lớn đã bỏ hỗ trợ phân đoạn ở chế độ 64-bit.

Ở cả chế độ thực và chế độ được bảo vệ, hệ thống sử dụng 16-bit đăng ký phân đoạn để lấy địa chỉ bộ nhớ thực. Ở chế độ thực, các thanh ghi CS, DS, SS và ES trỏ đến chương trình đang được sử dụng đoạn mã (CS), hiện tại phân đoạn dữ liệu (DS), hiện tại phân đoạn ngăn xếp (SS) và một thêm phân đoạn do người lập trình xác định (ES). Các Intel 80386, được giới thiệu vào năm 1985, bổ sung thêm hai thanh ghi phân đoạn, FS và GS, không có mục đích sử dụng cụ thể nào được xác định bởi phần cứng. Cách thức sử dụng các thanh ghi phân đoạn khác nhau giữa hai chế độ.[1]

Việc lựa chọn phân đoạn thường được bộ xử lý mặc định theo chức năng đang được thực thi. Các hướng dẫn luôn được tìm nạp từ đoạn mã. Mọi lần đẩy hoặc bật ngăn xếp hoặc bất kỳ tham chiếu dữ liệu nào tham chiếu đến ngăn xếp đều sử dụng phân đoạn ngăn xếp. Tất cả các tham chiếu khác đến dữ liệu đều sử dụng phân đoạn dữ liệu. Phân đoạn bổ sung là đích mặc định cho các hoạt động chuỗi (ví dụ: MOVS hoặc CMPS). FS và GS không có mục đích sử dụng do phần cứng chỉ định. Định dạng hướng dẫn cho phép một tùy chọn tiền tố phân đoạn byte có thể được sử dụng để ghi đè phân đoạn mặc định cho các hướng dẫn đã chọn nếu muốn

8 0
2 years ago
Other questions:
  • There are a few simple rules that you can follow to store and manage files and folders in your computer. What is the most import
    9·2 answers
  • Write a Java program that generates GUI (Graphical User Interface). Your program should provide labels and textfields to a user
    9·1 answer
  • Interactive sites where users write about personal topic and comment to threaded discussion are called?
    10·2 answers
  • Joann wants to insert page numbers at the bottom of the pages of her document using the Field option in Quick
    12·2 answers
  • What is the difference between the Internet and the World Wide Web? Explain in your own words.
    13·2 answers
  • Among object-oriented languages, one feature that varies considerably is whether the language allows multiple inheritance. C++ d
    5·1 answer
  • Which is the purpose of adding B-Roll footage to a sequence?
    10·1 answer
  • In the context of computer and network security, _____ means that a system must not allow the disclosing of information by anyon
    10·1 answer
  • February 1995, Kevin Mitnick was arrested. While on parole was he allowed to have a phone or computer?
    6·2 answers
  • Distinguished between
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!