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
ololo11 [35]
3 years ago
8

For the recursive method below, list the base case and the recursive statement, then show your work for solving a call to the re

cur() method using any parameter value 10 or greater.
public static int recur(int n)
{
if(n < 1)
{
return 3;
}
else
{
return recur(n / 5) + 2;
}
}

Computers and Technology
1 answer:
Paul [167]3 years ago
3 0

Answer:

(a): The base case: if(n<1)

(b): The recursive statement: recur(n / 5)

(c): Parameter 10 returns 7

Explanation:

Given

The above code segment

Solving (a): The base case:

The base case is that, which is used to stop the recursion. i.e. when the condition of the base case is true, the function is stopped.

In the given code, the base case is:

<em>if(n<1)</em>

Solving (b): The recursive statement:

The recursive statement is the statement within the function which calls the function.

In the given code, the recursive statement is:

<em> recur(n / 5)</em>

<em />

Solving (c): A call to recur() using 10

The base case is first tested

if (n < 1); This is false because 10 > 1

So, the recursive statement is executed

<em>recur(n/5) +2=> recur(10/5)+2 => recur(2)+2</em>

2 is passed to the function, and it returns 2

if (n < 1); This is false because 2 > 1

So, the recursive statement is executed

<em>recur(n/5) +2=> recur(2/5)+2 => recur(0)+2</em>

2 is passed to the function, and it returns 2

<em />

if (n < 1); This is true because 0 < 1

This returns 3

So, the following sum is returned

Returned values = 2 + 2 + 3

Returned values = 7

You might be interested in
Technician A says that the ECT and IAT sensors can be tested by using a digital multimeter or a scan tool. Technician B says tha
lara31 [8.8K]

Answer:

A) Both Techician A and B are correct

Explanation:

IAT refers to the Intake Air Temperature sensor while ECT refers to Electronically Controlled Transmission sensor. The IAT is a thermistor whose values changes based on the air temperature entering the engine, the ECT controls engine revolution. The statements in the questions by both technicians are correct

3 0
3 years ago
ASSIGNMENT FORM 2 1. Evaluate the following without using mathematical tables 0.36 x 6(142 +58) 21.44 - 10.64​
liq [111]
9251.44 or 231286/25 or 9251(11/25)

0.36*6*200*21.44-10.64
becomes
9262.08-10.64
gives you the result
8 0
2 years ago
With the ease of the Internet, it is not uncommon for individuals to copy skills from resume templates to make themselves look m
Butoxors [25]

Answer:

Content.

Explanation:

With the convenience of the Web, copying skills of resumes models is not unusual among people that create themselves seem quite appealing to such a recruiter. Understanding this, Ed developed a check to examine whether that person's job skills are about what's on the form.  

He is checking the validity of the content because It relates to that of the extent that the products on such a survey seem to be extremely determinative of the whole domain to be measured by the study.

7 0
3 years ago
3. Of the following pieces of information in a document, for which would you most likely insert a mail merge field? A. First nam
yuradex [85]
I would suggest the answer would be both A and D, mail merge is used to specify different field for different recipients. 
4 0
3 years ago
Read 2 more answers
Ncomputing and thin client<br>what it is <br>why is done , how it works and how it's <br> done ​
SVEN [57.7K]

The term NComputing  is known to be a form of desktop virtualization company that is said to creates hardware and software to form virtual desktops.

The term Thin clients is known to be virtual desktops. They help a lot of users at the same time to share a single operating system instance.

<h3>What is the aim of a thin client?</h3>

In Ncomputer networking, a thin client is known to be a kind of low-performance computer that is known to be optimized and used for setting up a remote connection.

It is often used with a server-based computing system. The server here is one that often does most of the work, such as launching software programs, etc.

Learn more about Ncomputing from

brainly.com/question/12629145

4 0
2 years ago
Other questions:
  • A(n) ____ backup only archives the files that have been modified since the last backup.
    11·1 answer
  • Websites that are designed to adapt gracefully to any screen size use a technique called
    5·1 answer
  • You have been asked to write a program that will ask the user for his or her pizza order and display it. The order will include
    11·1 answer
  • 11.The shortcut keys used to center a paragraph are&lt;br /&gt;a. CTRL+T&lt;br /&gt;b. CTRL+M&lt;br /&gt;c. CTRL+SHIFT+T d. CTRL
    7·1 answer
  • When a bank account pays compound interest, it pays interest not only on the principal amount that was deposited into the accoun
    10·1 answer
  • Assume the availability of a function named oneMore. This function receives an integer and returns one more than its parameter.
    14·1 answer
  • Write a program that first reads in the name of an input file and then reads the input file using the file.readlines() method. T
    7·1 answer
  • What software application is most appropriate to use to create multimedia presentations?
    6·2 answers
  • Which TWO of the following are input devices that are parts of a laptop computer?
    9·2 answers
  • What does syntax error mean :-;<br>explain briefly.<br><br>thankyou!
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!