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
Was LDAP version2 an internet standard in 1998? is it now?
mamaluj [8]

Answer Explanation:

LDAP stand for lightweight directory access protocol 389 is its port number it is an application layer protocol it was first invented in march 1998 and become very popular widespread  internet standard in august 1998 its authentication method is very simple the client send user name and password to LDAP server to access this.

4 0
3 years ago
is a measurement that quantifies how much information can be transmitted over the network. A. Memory B. DMZ C. Bandwidth D. Clou
AnnZ [28]

Answer: Bandwidth....

6 0
3 years ago
What in Microsoft word brings up mini toolbar
Ray Of Light [21]
You right click the mouse. hope this helps 
6 0
4 years ago
................,...
docker41 [41]

Answer:

there's a comma

Explanation:

after all those periods

6 0
4 years ago
Guidelines on how to write a report on how technology has affected office duties
UNO [17]

Answer:

weweweweweewewwewweewewweeew

Explanation:

weweweweewweweweewweewweewewew

5 0
3 years ago
Other questions:
  • The index number of a combobox object can be assigned to a(n) ____ data type variable
    13·1 answer
  • I'm stuck on this Java exercise problem and don't know how to organize my code with proper formatting and it's not helping that
    14·1 answer
  • Which best describes what a bibliography includes?
    8·1 answer
  • Liam is a hacker who tries to access Wi-Fi signals while driving his car. What type of wireless network attack is this?
    9·1 answer
  • Chapter 21 discusses four aspects of the speaking situation you should take into account when planning the graphics you'll use i
    15·1 answer
  • An exact-match query is:
    13·1 answer
  • Your mother wants to purchase a large hard drive for her computer and asks you to see what type of drive interface she has. Her
    13·1 answer
  • The process of preparing and setting up a software on a computer is called​
    15·1 answer
  • Apakah kebaikan mengetahui fungsi elemen pada produk mekatronik​
    5·1 answer
  • NEED HELP ASAP!!!
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!