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
dexar [7]
3 years ago
9

14) Modify the method that calculates the sum of the integers between 1 and N. Have the new version match the following recursiv

e definition: The sum of 1 to N is the sum of 1 to (N/2) plus the sum of (N/2 1) to N. Trace your solution using an N of 7.
Physics
1 answer:
Setler [38]3 years ago
8 0

Explanation:

Let solve the program using Java programming language

Method: method means group of statements to perform some operation.

             let call the method sum.

Parameters: list of variables that are use in the method for declaration.

<u>The code</u>

public int sum (int number)

int answer;

if (number == 1)

answer = number;

else

{

int half = number/2;

int span = number - half;

answer = sum(half) + sum(span) + (half * span);

}

answer result;

}

Firstly we defined the method called sum(), the method takes only one parameter which is number and return the answer(sum of  the integers 1 and N).

if the number is equal to 1, so it will return the number and if the number is not equal to 1 it will divide the number by 2 and get the span(span used to shift upper range).And result will add sum of half, sum of span and product of half span.

You might be interested in
The pedals on a bicycle give a mechanical advantage by allowing you to turn the pedals a __________ distance to turn the _______
Butoxors [25]
Letter c. Short, larger
6 0
3 years ago
Read 2 more answers
Which is not an example of unbalanced force acting on an object
Viktor [21]

Answer:

A motorcycle changing speed from 20km/h to 35km/h

Explanation:

it doesn't show unbalanced force acting on the object but instead, the motorcycle changing speed from 20km/h to 35km/h

4 0
2 years ago
How are a wave's energy and the wave's amplitude related?
dem82 [27]
Answer:
Energy is proportional to the square of the amplitude

Explanation:
The energy of a certain wave is defined using its magnitude.
The two quantities are related directly. This means that as the amplitude of the wave increases, its energy increases and vice versa.

Energy is directly proportional to the square of the magnitude of the wave. This means that:
If we have new amplitude = 2 * old amplitude
We will have new energy = (2)² * old energy = 4 * old energy

Hope this helps :)
7 0
3 years ago
Electric potential, unlike electric potential energy, is measured in units of _________.
podryga [215]
Electric pote measured in volt
6 0
3 years ago
Read 2 more answers
(a) A 15.0 kg block is released from rest at point A in the figure below. The track is frictionless except for the portion betwe
castortr0y [4]

Answer:

(a) coefficient of friction = 0.451

This was calculated by the application of energy conservation principle (the total sum of energy in a closed system is conserved)

(b) No, it comes to a stop 5.35m short of point B. This is so because the spring on expanding only does a work of 43 J on the block which is not enough to meet up the workdone of 398 J against friction.

Explanation:

The detailed step by step solution to this problems can be found in the attachment below. The solution for part (a) was divided into two: the motion of the body from point A to point B and from point B to point C. The total energy in the system is gotten from the initial gravitational potential energy. This energy becomes transformed into the work done against friction and the work done in compression the spring. A work of 398J was done in overcoming friction over a distance of 6.00m. The energy used in doing so is lost as friction is not a conservative force. This leaves only 43J of energy which compresses the spring. On expansion the spring does a work of 43J back on the block is only enough to push it over a distance of 0.65m stopping short of 5.35m from point B.

Thank you for reading and I hope this is helpful to you.

4 0
4 years ago
Other questions:
  • Dr Spock would have supported which of the following actions by parents
    10·1 answer
  • A 10 m long high tension power line carries a current of 20 A perpendicular to Earth's magnetic field of 5.5 x10⁻⁵ T. What is th
    12·1 answer
  • Which of the following can significantly change a vehicle’s center of gravity?
    10·2 answers
  • Why does it hurt your hands when you carry heavy shopping in carrier bags?
    5·2 answers
  • Your town is considering building a hydroelectric power plant. Describe at least two advantages and two disadvantages of this pr
    9·2 answers
  • How does the image distance and magnification give information about the type of image is produced bya lens or multiple lenses/
    7·1 answer
  • When I drop a bouncy ball it bounces back up to me. What force causes it to bounce?
    13·2 answers
  • Cartography is the science of​
    10·1 answer
  • Does visible have more energy than infrared radiation?
    15·1 answer
  • Indicate the direction of the magnetic force. A positive charge travels to the right of the page through a magnetic field that p
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!