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
You have been asked to investigate a web server for possible intrusion. You identify a script with the following code. What lang
nignag [31]

The code below is written in JavaScript and does not seem malicious.

<h3>What is a Malicious Code?</h3>

A Malicious code is one that is not designed for any productive end but to cause disruptions in the computer with the objective of

  • harming the workstation; or
  • destroying the data stored therein.

There are numerous classifications of malicious codes and they can be identified and removed by an application called an Anti-Virus or malicious app remover.

Learn more about JavaScript at:
brainly.com/question/16698901

8 0
3 years ago
If you want to conserve ink or toner, you can instruct PowerPoint to print ____ documents.
kondor19780726 [428]
I believe the answer would be Draft Quality. (300x300 resolution).

5 0
4 years ago
To insert a new slide, which tab option should you select?
jek_recluse [69]

Ithink that the answer is C)

4 0
3 years ago
Read 2 more answers
Given positive integer numinsects, write a while loop that prints that number doubled without reaching 100. follow each number w
hichkok12 [17]
Hi,

the program is as follows
___________________________________________________________


import java.io.*;
class doubleval

  {
     public static void main()throws IOException   
     {

       DataInputStream dt=new DataInputStream(System.in); 

System.out.println("Enter NUMBER WHOSE DOUBLE U WANT TO                                           PRINT");       
            int n=Integer.parseInt(dt.readLine()); 

                  for(int i=n;i<=100;i=2*i)       
                    {           
                         System.out.println(i);       
                            }   
            }
}


           
3 0
3 years ago
Given the function F (X, Y , Z)=Σm(0,1, 2 , 4 , 6)
Mnenie [13.5K]

Answer:

(1)Minterms complement = XYZ (2) Compliment of Minterms = Σm(0,1, 2 , 4 , 6) (3) (X+Y+Z) (4) Minimized SOP = Z + XY

Manterms = πM

Explanation:

Solution

Recall that:

Given the function F (X, Y , Z)=Σm(0,1, 2 , 4 , 6)

(1) Canonical Disjunctive Normal Form: In boolean algebra, the boolean function can be expressed as Canonical Disjunctive form known as minterms

In Minterm we assign 'I' to each uncomplimented variable and '0' to each complemented/complementary variable

For the given question stated we ave the following:

Minterms = XYZ, XYZ, XYZ, XYZ, XYZ.

(2) Canonical Conjunctive Normal Form: In boolean algebra, the boolean function can be expressed as Canonical Disjunctive form known as maxterms.

In Maxterms we assign '0' to each uncomplimented variable and '1' to each complemented/complementary variable

Compliment of Minterms = Σm(0,1, 2 , 4 , 6)

Maxterms = πM

Note: Kindly find an attached copy of the complete solution to this question below.

6 0
3 years ago
Other questions:
  • A slightly tapered thread is characteristic of a _______ tap.
    15·1 answer
  • In the INSERT statement that follows, assume that all of the table and column names are spelled correctly, that none of the colu
    9·1 answer
  • A(n) _____ is a type of server that stores computer software, which users can access from their workstations.
    6·1 answer
  • A collection of facts can be copyrighted, but only if the collection is ____ in a way that causes the resulting work to rise to
    14·1 answer
  • Write a java program which uses methods for calculating the sum of any 5 non-zero integer digits that are input. The program mus
    8·1 answer
  • When a compiler finds errors, it usually indicates what they are so you can correct the code and compile the program again?
    11·1 answer
  • The company where Derek works has tasked him with setting up and securing a SOHO router. He wants to make sure the wireless netw
    7·1 answer
  • A computer virus is a program that can copy itself and infect a computer without the permission of the owner. How do you think a
    9·1 answer
  • First person to make me laugh will get brainliest.​
    10·2 answers
  • Do small companies need computers? why?<br>​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!