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
balu736 [363]
3 years ago
10

Consider the following recursive method: public int someFun(int n) { if (n <= 0) return 2; else return someFun(n-1) * someFun

(n-1); } (a) When the program calls someFun(5), how many times will someFun(3) be called? (b) What does this method calculate when the input parameter n is a non-negative integer?
Computers and Technology
1 answer:
Stella [2.4K]3 years ago
3 0

Answer:

(a) someFunc(3) will be called 4 times.

(b) For non negative number n someFunc method calculates 2^2^n.

Explanation:

When you call someFunc(5) it will call someFunc(4) two time.

So now we have two someFunc(4) now each someFunc(4) will call someFunc(3) two times.Hence the call to someFun(3) is 4 times.

someFunc(n) calculates someFunc(n-1) two times and calculates it's product.

someFunc(n) = someFunc(n-1)^2..........(1)

someFunc(n-1)=someFunc(n-2)^2..........(2)

substituting the value form eq2 to eq 1.

someFunc(n)=someFunc(n-2)^2^2

       .

       .

       .

       .

= someFunc(n-n)^2^n.

=2^2^n

2 raised to the power 2 raised to the power n.

You might be interested in
User accounts will be locked out after authentication is attempted
Tatiana [17]
Whats is the question ?
7 0
3 years ago
This is a tableware use to serve the main dish
GuDViN [60]

Answer:

<em>Dinner plate is a type of plate used for main courses. The average dinner plate measures 11 or 12 inches across. This plate is the most used plate during the entire meal and it usually comes out after the salad, it is the plate resting just above the charger.</em>

6 0
2 years ago
Concentric circles on a disk platter where data is stored;________
bagirrra123 [75]

Answer:

Tracks

Resilient File System (ReFS)

Explanation:

  1. Concentric circles on a disk platter where data is stored is called Tracks
  2. The new file system developed for Windows Server 2012 is called Resilient File System (ReFS). It allows increased stability for disk storage and improved features for data recovery and error checking
4 0
3 years ago
Which of the following is an example of a Boolean operator?
miv72 [106K]

Answer:

C. But

Explanation:

Boolean operators are the operators that may have only two outputs which are True/False, On/Off and 1/0.

"But" can also be the example of Boolean operator. It is used in the meaning of "except" or "other than".

In Boolean operators "But" can be used as "AND" operator.

for example

<em>I am busy but I will go.</em>

In above example but is used as and which is combining two oposite statements. as

I am busy  and I will go.

Both statement oppose each other, so to make sense in English "But" is used.

7 0
3 years ago
Abby has received a request for a data set of actual data for testing a new app that is being developed. She does not want the s
Andreas93 [3]

Q:

Abby has received a request for a data set of actual data for testing a new app that is being developed. She does not want the sensitive elements of the data to be exposed. What technology should she use?

A:

Masking

4 0
2 years ago
Other questions:
  • Which is the correct process for adding page numbers to a spreadsheet you will print? A. Click Page Break Preview. Type the page
    7·1 answer
  • To arrange data in alphabetical order quickly, you can _____ the data.
    7·2 answers
  • You save $500 in a retirement account at age 25. it increases an average of 10% per year until you are 65. which formula and res
    13·1 answer
  • Write three statements to print the first three elements of array runTimes. Follow each statement with a newline. Ex: If runTime
    12·1 answer
  • Write a program that converst the temperature from Celcius to Fahrenheit. The formula is: F (9/5)C+32
    12·2 answers
  • Create a class named Console, and move all the methods that retrieve and validate user input to that class. These methods can re
    7·1 answer
  • Your friend's job pays $5.00 per hour, and he works 20 hours per week. His tax rate is 20 percent. Assuming he works 50 weeks of
    11·2 answers
  • I NEED THIS ASAP PLS
    12·1 answer
  • Pls say correct guyz pls pls pls
    7·1 answer
  • One word for The characters typed by a user using a<br> keyboard.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!