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
Beside homework, what products can you use for personal use? Identify three uses and briefly describe.
Dominik [7]
<span>Beside homework, what products can you use for personal use? Identify three uses and briefly describe.

</span>
3 0
3 years ago
Read 2 more answers
What are the correct answers to the following questions?
Lena [83]

Answer:

1. analog sound

2. digital sound

3. pixels

4.  local area network

5.bus

6. slots

Explanation:

4 0
2 years ago
Data in the form of digits is called
Flauer [41]
Numeric data because it consist of numbers
5 0
2 years ago
A question to determine your ability to use the reference materials effectively. Your boss has determined that you will be using
Ymorist [56]

Answer:

The answer is "implement on group 2 and group 3".

Explanation:

In the given scenario, When technology workers are using in the project teams. People like to be stable, and we can't allow wireless network transmission to maintain their security and privacy. When we considering category 1 being the only ones who have links to a higher authority, that's why Group 2 and Group 3 were needing to be implemented.

3 0
2 years ago
The beginning balance of Keyshawn's savings account for the month of September was $3900, and it remained this way for the first
Doss [256]
I’m not gonna wanna was that 638
4 0
3 years ago
Other questions:
  • Make sure to read all of these specifications carefully. Write a function, named array_shifter, that accepts an array of doubles
    12·1 answer
  • Floppy disks hold more data than a CD-R/RW.<br> true or false?
    8·2 answers
  • A server-side extension ________________. provides its services to the web server in a way that is totally transparent to the cl
    13·1 answer
  • Among the many DTP software tools available today, which is regarded as the industry standard for DTP?
    13·2 answers
  • Why would an IT technician ever have to change out a computer’s motherboard?
    5·2 answers
  • According to your​ reading, Macy's uses​ ________ technology to track individual items for sale on store shelves.
    5·2 answers
  • Winners announced tomorrow when I check results ngl I gtg to sleep soon I should see a lot of people tomorrow ^^
    8·1 answer
  • A large company has a LAN. The manager of the company wants to change it to a WAN
    10·1 answer
  • You and a friend have just started a small business. How could you use the Internet to make your business successful?
    15·2 answers
  • you want to upgrade your windows 10 professional computer to windows 11 professional. you begin by checking the hardware and dis
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!