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
Vedmedyk [2.9K]
1 year ago
6

Write a recursive function named canmakesum that takes a list of * integers and an integer target value (sum) and returns true i

f it is * possible to have some set of values from the list that sum to the * target value.
Computers and Technology
1 answer:
valentinak56 [21]1 year ago
7 0

// Java program to find sum of array

// elements using recursion.

class Test {

   static int arr[] = { 1, 2, 3, 4, 5 };

   // Return sum of elements in A[0..N-1]

   // using recursion.

   static int findSum(int A[], int N)

   {

       if (N <= 0)

           return 0;

       return (findSum(A, N - 1) + A[N - 1]);

   }

   // Driver method

   public static void main(String[] args)

   {

       System.out.println(findSum(arr, arr.length));

   }

}

You might be interested in
Calls to the tostring( ) method emphasize the use of ____.
DaniilM [7]
<span>Polymorphic message
   
Methods in different classes with a similar function are given the same name. - Makes classes easier to use because programmers need to remember fewer method names. - Employed as much as possible. - Polymorphic message ex. is the toString method.</span>
5 0
2 years ago
Different algorithms can be made to complete the same task in different ways.
musickatia [10]

Answer:

True hope this helps you and everyone!

7 0
2 years ago
Read 2 more answers
Each web site contains a(n) ____ page, which is the first document users see when they access the site.
katrin2010 [14]
Home is the answer. Hope this helps. :)
7 0
3 years ago
Which one of the following items would you be most likely to keep in a database? A. Payroll records B. Address book C. Financial
True [87]
The item that you would most likely to keep in a database is a Payroll record. Payroll records are numbers and inputs/outputs of employees of a certain company. Numbers are easier to manipulate and easier to manage than statements, letters and addresses that are basically letters.
3 0
3 years ago
Which of the following is most often added to safety glasses to provide better protection from impact and flying particles? A. S
Vesnalui [34]

the answer is side shields cause the side shields gives more protection to the eyes than just the lens because the flying objects and particals can still get into your eyes even with the safty glasses but with the side shields the total risk of injury percentage goes down because the side shields helps blocks the flying objects and particals that are trying to get into your eye from the side

8 0
3 years ago
Other questions:
  • What are some ways to accept data typed into a cell? Check all that apply.
    15·1 answer
  • Erick, who is taking an online course, sent an e-mail to his
    14·2 answers
  • Consider that a large online company that provides a widely used search engine, social network, and/or news service is consideri
    12·1 answer
  • You need to prevent the use of tftp through your firewall. which port would you block?
    9·1 answer
  • In CadStd, what does the Zoom All button do? A. Makes a drawing bigger so you can see small details B. Returns a drawing to a si
    5·1 answer
  • According to your text, three factors are responsible for the rapid rise in new product development. They are faster and more ec
    9·1 answer
  • To give your app users the ability to open your app directly from other apps by clicking a link, you should use:.
    11·1 answer
  • Convert 128 GB into KB​
    8·2 answers
  • How does calculate() work?
    6·2 answers
  • Help plz
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!