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
The CEO of CorpNet.xyz has hired your firm to obtain some passwords for their company. A senior IT network administrator, Oliver
MA_775_DIABLO [31]

Answer:

The olennon account's password: See the attached file for this.

The Administrator account's password: 4Lm87Qde

Explanation:

Note: See the attached excel file for the olennon account's password as I was unable to save it here because I was instead getting the following message:

"Oh no! It seems that your answer contains swearwords. You can't add it!"

The olennon account's password and the Administrator account's password can be found as follows:

To see the rear of the computer, click Back from the menu bar above the computer.

Drag the USB Type A connector for the keyboard from the rear of the computer to another USB port on the machine.

Make sure the keyboard is plugged back in.

Expand System Cases on the shelf.

Add the Laptop to the Workspace by dragging it there.

To see the rear of the laptop, click Back from the menu above the laptop.

Drag the keylogger from the computer to the laptop's USB port.

Select Front from the menu above the laptop to see the front of the laptop.

Select Click to display Windows 10 on the laptop.

Toggle between keylogger and flash drive mode by pressing S + B + K.

To control what occurs with detachable drives, select Tap.

To view files, choose Open folder.

To open the file, double-click LOG.txt.

Select Answer Questions in the top right corner.

Respond to the questions.

Choose Score Lab as the option.

Therefore, we have:

The olennon account's password:

The Administrator account's password: 4Lm87Qde

Download docx
7 0
3 years ago
The main reason to set a field size in access is to:
Nadya [2.5K]
The main reason to set a field size in access is to limit the lengths of value in the table.
Field size determines the limits or determines the maximum of text that can be input in the text or number field. Also, it may reduce data entry errors in changing the field size in access.
4 0
3 years ago
Drag each tile to the correct box.
SVEN [57.7K]

  • Learning : For performing any task you need to learn from the basiscs .
  • planning : planning is the main part . unless and until you dont know how to design and what to design , what will you design ?
  • Designing : After laying a layer of well set up plane u need to look up , and break your head in physically implying it .
  • Devaloped : This place is where you detect flaws in your system , work with that and makes it even better .
  • Testing and delevering : The product is designed , U just need to test and delever it to consumers .
6 0
3 years ago
Which device assists with medical imaging
masya89 [10]
MRI- Magnetic Resonance Imaging

        OR

USI- Ultrasound Imaging
5 0
3 years ago
Read 2 more answers
What is the basic difference between x.509 and pgp in terms of key hierarchy and key trust?
ra1l [238]
In terms of key hierarchy, you have to request to a Certification Authority in order for them to issue you an X.509 certificate. On the other hand, you can creat your own pgp.

In terms of key trust, X.509 supports only a sole key owner. It can support only one digital signature to confirm the key's validity. This does not work for pgp.
3 0
3 years ago
Other questions:
  • Select the correct answer from each drop-down menu. Select the correct type of address reference.
    6·2 answers
  • One problem with using e-mail is that ______. a. It can be perceived as being too casual b. It is never appropriate for business
    12·1 answer
  • The ______________________ is the part of the ip address that is the same among computers in a network segment.
    9·1 answer
  • 5. The hazardous component in most antifreeze is _____, which is extremely toxic to humans and animals. A) Calcium Carbonate B)
    13·2 answers
  • If you wanted to buy a house that cost $150,000 and you knew you needed a down payment of five percent, how much would you need
    8·1 answer
  • Coordinate with
    12·1 answer
  • The word __________ refers to the numbers, words, or more generally, any collection of symbols that is manipulated by a program.
    7·1 answer
  • Habilidades de la alfabetizacion digital?
    12·1 answer
  • What is the importance of the international employment​
    8·2 answers
  • The sum of these 9 numbers is 36. 2, 2, 6, 2, 1, 8, 7, 5, 3 What is the mean of these 9 numbers?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!