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
xeze [42]
4 years ago
10

Please help!

Computers and Technology
1 answer:
USPshnik [31]4 years ago
8 0

Answer:

x == y

How? :

So in this case for recursion to stop, the program needs to reach a base case. A base case is a situation where coming across that line of code will give a certain output, meaning it will definitely give an output and not go back into to the program. For example, if you have a program very similar to yours with recursion, and the program continues to run until it hits the value 1. Now, say you had specified in the code for the method that if the int (integer) value of the int variable x equals 1, the code would return 1. This situation in java would look like:

if (x == 1) return 1;

<em>or</em>

if (x == 1){

    return 1;

}

This is what you would call a base case. Now, if you were to enter two values into the method for your code, what would you get? Let's say you enter 3 and 6 (3 for int x, and 6 for int y). In this case the value of variables x and y would satisfy the code, and recursion would occur, where outputs continue to loop until you hit a wall, where output satisfies a base case. For your situation, a base case would be where x can be less than five, y can be greater than five, but, most importantly, x and y do not satisfy the condition where x != y. If you don't know what that means, x != y means "x is not equal to y". So for the values of x and y to not not be equal (sorry if this is confusing), the values of x and y have to be equal. Now, if you were to pug in 6 and 6 in your code, you would an output of just one line - "y: 6" and nothing else. Tada! Recursion has ended since the output has satisfied a base case -  "x and y are equal" i.e. x == y . Thus, the correct answer would be x == y. Hope my explanation helped.

Take care,

Somebody

You might be interested in
Entering the formula =sum(c5:c18) in cell c19 will result in which of the following?
antiseptic1488 [7]
If you mean Excel formula sum(c5:c18) in cell c19 will show <span>c. the total of cells c5 to c18 will appear in cell c19. It's simple operation that simplyfies counting different values.</span>
5 0
3 years ago
Which options are available in the Conditional Formatting dialog box? Check all that apply.
IrinaVladis [17]

Answer:

There are several options within this dialog box for applying Conditional Formatting ☼ Click the desired option under the Select a Rule Type list. ☼ The bottom portion of the dialog box will change depending on the Rule Type that was selected. ✞ Click Format Only Cells That Contain under Select a Rule Type

6 0
3 years ago
Read 2 more answers
Which of the following is NOT considered a digital assets
sweet [91]

Answer:

D. An image you do not have the right to use

Explanation:

Since you don't have the rights to use the image it isn't considered a digital asset.

3 0
3 years ago
How to find the volume of cube in computer in QBASIC program ​
otez555 [7]

Answer:

QBasic Programming

REM PROGRAM TO DISPLAY VOLUME OF CUBE. CLS. INPUT “ENTER LENGTH”; L. ...

USING SUB PROCEDURE.

DECLARE SUB VOLUME(L) CLS. INPUT “ENTER LENGTH”; L. ...

SUB VOLUME (L) V = L ^ 3. PRINT “VOLUME OF CUBE ”; V. ...

USING FUNCTION PROCEDURE.

DECLARE FUNCTION VOLUME (L) CLS. ...

FUNCTION VOLUME (L) VOLUME = L ^ 3.

3 0
3 years ago
The java compiler is able to find all programmer errors.
Troyanec [42]
No compiler can do that. Maybe with AI, but that's beyond the scope of a compiler.
5 0
4 years ago
Other questions:
  • Bullet points on a slide should be limited to _____. 2 4 8 10
    15·2 answers
  • In an image citation, what piece of information is listed first?
    14·1 answer
  • Assume s is a string of lower case characters.
    15·1 answer
  • Is it ok to use a does red wine clean the inside of a computer true or false
    10·2 answers
  • I’ll mark who ever is first or last Doesn’t matter JUST PLEASE HELP
    8·1 answer
  • Which of the following industries utilize computer science?
    13·1 answer
  • What are the steps in preparing a bootable USB installer?​
    11·1 answer
  • In which directory would a system administrator store scripts that should be run monthly by the cron daemon?
    10·1 answer
  • What rpm command can be used to list the full paths for files within the bash package?
    10·1 answer
  • Shreya has combined all the cells in a single leftmost column in a table. Instead of identifying the category multiple times, sh
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!