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
olasank [31]
3 years ago
8

Refer to the method f: Public int f( int k, int n ) { if( n == k ) return k; else if( n > k ) return f( k, n - k ); else retu

rn f( k - n, n ); } What value is returned by the call f( 6, 8 )?
Computers and Technology
1 answer:
Debora [2.8K]3 years ago
5 0

Answer:

Returned value: 2

Explanation:

Public int f(int k, int n) {

   if (n == k)

       return k;

   else if (n > k)

       return f(k, n - k);

   else return f(k - n, n);

}

/////////////////////////////////////////////////////////////////////////////////////////

Trace of function calls,

f(6, 8)

f(k, n - k) -> (6, 2)

f(k - n, n) -> (4, 2)

f(k - n, n) -> (2, 2)

return k

You might be interested in
Write essay about pokhara​
myrzilka [38]

Explanation:

Pokhara is the second most visited city in Nepal, as well as one of the most popular tourist destinations. It is famous for its tranquil atmosphere and the beautiful surrounding countryside. Pokhara lies on the shores of the Phewa Lake. From Pokhara you can see three out of the ten highest mountains in the world (Dhaulagiri, Annapurna, Manasalu). The Machhapuchre (“Fishtail”) has become the icon of the city, thanks to its pointed peak.

As the base for trekkers who make the popular Annapurna Circuit, Pokhara offers many sightseeing opportunities. Lakeside is the area of the town located on the shores of Phewa Lake, and it is full of shops and restaurants. On the south-end of town, visitors can catch a boat to the historic Barahi temple, which is located on an island in the Phewa Lake.

On a hill overlooking the southern end of Phewa Lake, you will find the World Peace Stupa. From here, you can see a spectacular view of the lake, of Pokhara and Annapurna Himalayas. Sarangkot is a hill on the southern side of the lake which offers a wonderful dawn panorama, with green valleys framed by the snow-capped Annapurnas. The Seti Gandaki River has created spectacular gorges in and around the city. At places it is only a few meters wide and runs so far below that it is not visible from the top

5 0
3 years ago
What facilitates the automation and management of business processes and controls the movement of work through the business proc
zhenek [66]

Answer:

D. Workflow management systems

Explanation:

Workflow management systems can be defined as a strategic software application or program designed to avail companies the infrastructure to setup, define, create and manage the performance or execution of series of sequential tasks, as well as respond to workflow participants.

Some of the international bodies that establish standards used in workflow management are;

1. World Wide Web Consortium.

2. Workflow Management Coalition.

3. Organization for the Advancement of Structured Information Standards (OASIS).

Workflow management systems facilitates the automation and management of business processes and controls the movement of work through the business process.

<em>The following are various types of workflow management systems used around the world; YAWL, Windows Workflow Foundation, Apache ODE, Collective Knowledge, Workflow Gen, PRPC, Salesforce.com, jBPM, Bonita BPM etc.</em>

3 0
3 years ago
Why might you use the More button in the Find and Replace dialog box?
den301095 [7]

Answer:

Use the More button to display more options to help narrow the search criteria.

Explanation:

<em> I think hope this helps you!!</em>

6 0
2 years ago
Write a function listLengthOfAllWords which takes in an array of words (strings), and returns an array of numbers representing t
vesna_86 [32]

Answer:

   public static int[] listLengthOfAllWords(String [] wordArray){

       int[] intArray = new int[wordArray.length];

       for (int i=0; i<intArray.length; i++){

           int lenOfWord = wordArray[i].length();

           intArray[i]=lenOfWord;

       }

       return intArray;

   }

Explanation:

  1. Declare the method to return an array of ints and accept an array of string as a parameter
  2. within the method declare an array of integers with same length as the string array received as a parameter.
  3. Iterate using for loop over the array of string and extract the length of each word using this statement  int lenOfWord = wordArray[i].length();
  4. Assign the length of each word in the String array to the new Integer array with this statement intArray[i]=lenOfWord;
  5. Return the Integer Array

A Complete Java program with a call to the method is given below

<em>import java.util.Arrays;</em>

<em>import java.util.Scanner;</em>

<em>public class ANot {</em>

<em>    public static void main(String[] args) {</em>

<em>       String []wordArray = {"John", "James", "David", "Peter", "Davidson"};</em>

<em>        System.out.println(Arrays.toString(listLengthOfAllWords(wordArray)));</em>

<em>        }</em>

<em>    public static int[] listLengthOfAllWords(String [] wordArray){</em>

<em>        int[] intArray = new int[wordArray.length];</em>

<em>        for (int i=0; i<wordArray.length; i++){</em>

<em>            int lenOfWord = wordArray[i].length();</em>

<em>            intArray[i]=lenOfWord;</em>

<em>        }</em>

<em>        return intArray;</em>

<em>    }</em>

<em>}</em>

This program gives the following array as output: [4, 5, 5, 5, 8]

7 0
3 years ago
ACTIVITY NO. 5 (DAY 5) FACT OR BLUFF. Write Fact if the statement is correct and write Bluff if it is incorrect.
KengaRu [80]

All of the above are Facts.

preventive maintenance does indeed help with the lifespan etc.

If you are feeling tired or fatigued when operating machinery, stop and rest for fear of mistake. So , two is also correct

4if you dress inappropriately it may cause danger from getting caught in machinery or catching a flame depending on the worksite. so four is correct. Newer models are most likely more updated and have different operations then the last machine. so yes read the manual before using it. so yet again 5 is also correct.

hopefully this helped

3 0
3 years ago
Other questions:
  • Describe encryption at gateways in thePresentation layer of the OSI Reference Model
    6·1 answer
  • Whos ready for sao ordinal scale this march!!!( ಥـْـِـِـِـْಥ)
    7·1 answer
  • Identify the six components of an information system. Which are most directly affected by the study of computer security? Which
    8·1 answer
  • Can you awnser this question
    15·1 answer
  • For enterprise servers, or servers accessed around the clock, SATA disks are preferred over SAS disks. True or False
    12·1 answer
  • I made Pico with a Ray Gun (Next is Dad/Tankman)<br><br> Opinons?
    11·2 answers
  • Refer to the image on the right. Then, using the drop-down menu, identify the correct printer type. A: inexpensive home printer
    10·1 answer
  • Your job is to choose a data structure to implement polynomials whose coefficients are positive integers, such as 17x^4+4x^3+0x^
    9·1 answer
  • What is phishing?
    14·1 answer
  • each data mining technique has its advantages and limitations. which data mining technique mimics the neural structure of the br
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!