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
According to the stage-gate process developed by Robert G. Cooper, _____ are the results of the previous stage and are the input
riadik2000 [5.3K]

Answer: (A) deliverables

Explanation:

In stage gate process we have distinct phases, where the deliverables  are the results of the previous stage and are the inputs for the gate review.

5 0
3 years ago
Engineers and scientists redesign a prototype if it does not work correctly true or false and why
Rasek [7]
True they would not start to use a product if it would not work
Hope this helps please mark this as brainliest answer
4 0
3 years ago
Read 2 more answers
The most efficient way to perform data entry is to keep your hands on the keyboard and press _______ to move to the next cell in
SCORPION-xisa [38]
The correct answer is C. Tab; enter
5 0
3 years ago
**NEED HELP??!! Computer Science Questions!! KNOWING GIMP!!!!
Svetlanka [38]
<span>1. If my memory serves me well,  the answer is true. Free select tool is also called lasso and it’s used to free-hand selection. You can also combine free select tool segments with polygonal segments or other shapes.

2. I think this statement is definitely “False”. As I’ve mentioned before you can combine free selection with other selection features like polygonal by using anchors.

3. I’m not 100% sure, but I guess this one is true. As far as I remember, add to selection mode lets you to add new selection to any existing areas. So I think it’s possible to add selection to the existing one.

4. I think this one is also true. But it allows you just paint it, but it’s also kinda modification. Quick Mask allows you to isolate subject and paint selected object. It helps you not to brush subject accidentally. It’s a very useful tool as for me.

5. Yes, this statement is 100% true. But it could be gray for GIMP, because the mask is coded in gray tones, but I think that black is also gray tone. Color black or gray removes part of selection, and color white adds area to existing selection.

6. According to what I’ve mentioned before this one is also true, so there’s no need for additional explanation.

7. Another tool, similar to the Lasso/Free Select tool is the B) Scissors Tool. As there was mentioned intelligent scissors tool is almost the same as lasso but more user-friendly.

8. It’s false. You must click to the first point of your selection to finish the process or you will lose your selection.

9. I think this one is true. Paths tool includes two or more line segments connected by handle points. These points are kinda anchors I guess.

10. After making a selection using the Paths Tool, I must select the the D) Selection from Path button to turn my path into a selection. You can find it in path tool options.

11. Yes, it’s true, it allows you to make complex selections with curved or straight lines. Just drag one of the anchors to curve the line. Also you can create different geometrical figures with this tool.

12. Yes this is true. But there are much more cool blur filters than only Gaussian blur. Experiment on your own.

13. You can do all of the following given above. Every layer is kinda isolated image and you can modify it however you want.
<span>
14. I’m definitely sure that this statement is true. Just find layer drop down menu and follow the instructions given in this question. It’s simple.</span></span>
8 0
3 years ago
What console can be used to enable disable start or stop a service
umka21 [38]
That would be msconfig!
5 0
3 years ago
Other questions:
  • How can an Excel table be added to a Word document? Check all that apply.
    15·1 answer
  • Higher-speed Ethernet technologies use an electronic device known as a Hub rather than a switch True/False
    15·1 answer
  • Grooves and polished surfaces on desert pebbles are most likely caused by
    10·1 answer
  • Which elements are in the Sort dialog box? Check all that apply.
    9·1 answer
  • William is an HR manager in a textile-manufacturing firm. He is creating a file on the hours each employee worked during the las
    6·2 answers
  • Please be my friend. my best and only friend isn't talking to me for some reason
    9·2 answers
  • Brainliest for correct answer
    13·2 answers
  • What the central difference between negative and positive politeness?
    13·2 answers
  • When adding a component to a container with the ____ layout, specify the NORTH, EAST, SOUTH, WEST, or CENTER position.
    8·1 answer
  • What are some of the most common obstacles in video games?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!