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

1) Create a recursive program that prompts the user for a nonnegative integer N and outputs. a) Sum [N] b) BiPower [N] c) TimesF

ive [N] Describe any input constraints in the opening comment of your recursive methods
Computers and Technology
1 answer:
Georgia [21]3 years ago
4 0

Answer:

//Code is created using java

import java.util.*;

// returns the sum

public int sum(int N)

{

if(N==1)

return (1);

else

return N+sum(N-1);

}

// code to return the Bipower ouput

public int BiPower(int N)

{

if(N==1)

return (2);

else

return 2*BiPower(N-1);

}

// Code to return TimesFive output

public int TimesFive(int N)

{

if(N==1)

return 5;

else

return 5 + timesFive(N-1);

}

public static void main(String args[])

   {

//Prompts the user to enter a nonnegative integer

       int N  = Integer.parseInt.(console.readLine("Enter a nonnegative integer:  "));

//Outputs the sum, Bipower and TimesFive

       System.out.println(sum(n));

       System.out.println(BiPower(n));  

       System.out.println(TimesFive(n));

   }

}

You might be interested in
Jacob is preparing a presentation on the health and social advantages of taking up a sport at an early age. Most of the slides i
8090 [49]

Answer:

C. Make the slide image large so the charts can be seen clearly.

Explanation: Edg

8 0
2 years ago
Which of the following are examples of IT
Advocard [28]

Answer:

Computer hardware engineer

Systems analyst

Database administrator

7 0
3 years ago
Why is Thomas Jefferson considered an accomplished man , or a Renaissance man?​
lesantik [10]
The term “Renaissance man” means for a very clever person to be good at many different things.
4 0
3 years ago
In the word interrupting, the root word rupt means:
Tatiana [17]
A. break, because if you were to interrupt someone mid-conversation you would essentially be 'breaking' their speech. In erupt it seems more like burst but could also be break because the lava erupting from the volcano breaks or damages its surroundings. Just a guess.
5 0
3 years ago
Read 2 more answers
You have a desktop computer that supports both IEEE 1394 and USB 2.0. You are purchasing some devices that will connect to these
zimovet [89]

Answer:

IEEE 1394 supports more devices on a single bus

Explanation:

What this means is that IEEE 1394 provides a single plug-and-socket connection on which up to 63 devices can be attached with data transfer speeds up to 400 Mbps (megabit s per second). The standard describes a serial bus( A shared channel that transmits data one bit after the other over a single wire or fiber) or pathway between one or more peripheral devices and your computer's microprocessor .

7 0
3 years ago
Other questions:
  • What is the difference between Data and information?​
    7·1 answer
  • True or false: when considering data backups, it is most important to verify that the integrity of the backup file or data is va
    9·1 answer
  • In gaming, "rendering" refers to:
    12·2 answers
  • Does a BIOS reset erase data such as pictures, programs or other things like that?
    13·1 answer
  • Which website allows you to host your podcast for at a cost that includes your domain name?
    9·2 answers
  • Why did Hunter gatherers moved into the<br>America's?​
    8·1 answer
  • Given a String variable named sentence that has been initialized, write an expression whose value is the number of characters in
    13·1 answer
  • what term defines inventiveness uncertainty and futuristic ideas typically deals with science and technology
    15·1 answer
  • Write a python program that should determine from the range you choose to enter :
    9·1 answer
  • Write a program that produces the following output: CCCCCCCCC ++ ++ CC ++ ++ CC ++++++++++++++ +++++++++++++++ CC ++++++++++++++
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!