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 underlying concept is edge computing based on?
guajiro [1.7K]

Answer:

Edge computing was developed due to the exponential growth of IoT devices, which connect to the internet for either receiving information from the cloud or delivering data back to the cloud. And many IoT devices generate enormous amounts of data during the course of their operations.

Explanation:

8 0
2 years ago
Read 2 more answers
Write a method that takes two circles, and returns the sum of the areas of the circles.
11111nata11111 [884]

Answer:

public static double areaSum(Circle c1, Circle c2){

 double c1Radius = c1.getRadius();

 double c2Radius = c2.getRadius();

 return Math.PI * (Math.pow(c1Radius, 2) + Math.pow(c2Radius, 2));

public static void main(String[] args){

 Circle c1 = new Circle(6.0);

 Circle c2 = new Circle(8.0);

  areaSum(c1,c2);

 }

Explanation:

7 0
2 years ago
A_________is an orderly collection of fact & information.
sammy [17]

Answer:

C. Database

Explanation:

4 0
3 years ago
_______ allow(s) you to apply colorful, eye catching designs to a presentation all at once.
astraxan [27]

What are some options of answers, or is there none?


4 0
3 years ago
Read 2 more answers
Which invention provided instant communication and information to a massive audience for the first time?
igor_vitrenko [27]
B. Television. It provided <span>instant communication and information to a massive audience for the first time in 1927.

Hope this helps :)</span>
4 0
3 years ago
Read 2 more answers
Other questions:
  • This technology was developed in the 1980s and was a successful attempt to provide services for voice, video, and video traffic
    11·1 answer
  • How to write a program that prompts the user to input two POSITIVE numbers — a dividend (numerator) and a divisor (denominator).
    13·1 answer
  • Outsourcing is an alternative systems building approach that may involve subscribing to an application service provider or hirin
    8·1 answer
  • A(n) _________ is a lan that uses the same technologies as the internet but is provided to invited users outside the organizatio
    12·1 answer
  • • Open your Netbeans IDE and answer the following question
    5·1 answer
  • Rule number one for handling an emergency is to _____. A. buy a new vehicle B. call law enforcement C. remain calm D. restart th
    6·2 answers
  • . A wireless ……..is a device used to resolvewireless network connectivity problems.
    8·1 answer
  • Mary can view the thumbnails of her presentation slides when she’s creating the slides which element of the programs interface i
    8·1 answer
  • Who is famous for his three laws of robotics?
    9·1 answer
  • 1) What is Database? List its Uses.<br>​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!