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
What items should you evaluate when scouting the facilities at a shooting location?
Fiesta28 [93]

I would evaluate baggage and personal belongings, rooms or closets, people's clothing, and if anyone has a weapon.

3 0
3 years ago
Which of the following should you do if you are exhibiting your photographs?
Naddika [18.5K]

I would go with option a

hope that helped

3 0
3 years ago
Please don't guess answer for points!!
Irina-Kira [14]

Answer:

The answer is weak, Have a nice day! :)

Explanation:

D) weak

6 0
2 years ago
Read 2 more answers
What sorts of routine, seemingly unimportant information would help you learn about or break into another company’s network?
tatuchka [14]

Answer and Explanation:

  • Reboot your Computer from which you need to break into.
  • With your remote Ethernet card embedded and the unprotected passageway will mate up in a flash. You likewise need to change the Service Set Identifier (SSID) on your Ethernet card to coordinate SSID on the system's passage. You can decide to physically constrain your DHCP settings to reestablish, however on the off chance that that gives you any trouble.we need to re-boot it.
  • The Third Man ran a sniffer program that caught the majority of the LAN traffic within this organization. It was transmitted through the remote passageway straight into the Third Man's PC. Passwords. Agreements. Email.
4 0
3 years ago
Most GUIs provide all of the following except _____.
erma4kov [3.2K]

Hello there! Your answer would be A.

GUIs are Graphical user interfaces. Command prompts are unique to Windows operators, so your best option would be A since the question covers most GUIs.

Hope this helps, have a great day!

7 0
3 years ago
Other questions:
  • What is one word for inventiveness uncertainty and futuristic
    5·1 answer
  • Intro to cs 3.7 edhesive g=float(input("Enter your English test grade:")) if(g<=64): print("F") if (g>=65 and g<69): pr
    11·1 answer
  • Public static String doSomething(String s) { final String BLANK = " "; //BLANK contains a single space String str = ""; //empty
    6·1 answer
  • Peter works on a huge database of numerical figures in a worksheet ranging from cell A1 to cell I50. He has to print the workshe
    15·2 answers
  • When entering data in Access if the data is entered using an Access form, that data is stored in a table or tables. TRUE FALSE
    12·1 answer
  • A computer technician is responding to a call about a printer that is causing streaks to appear on every printout. Which of the
    5·1 answer
  • What is the data type of the following expression?
    12·2 answers
  • Write a program that will ask the user for a set of ten numbers. After all ten numbers have been entered, the program will displ
    15·1 answer
  • Pls help I don’t know the answers
    15·1 answer
  • How to use boolean to check if math answer is correct java
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!