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
Marco is conducting an experiment. He knows the wave that he is working with has a wavelength of 32.4 cm. If he measures the fre
liq [111]

Answer:  D. the wave has traveled 97.2 cm in 1 second.

Explanation:

Got it right on edge, hope this helps :)

7 0
3 years ago
A rocket at rest with a mass of 942 kg is acted on by an average net force of 6,731 N upwards for 21 s. What is the final veloci
Galina-37 [17]

Answer:

Explanation:

Givens

m = 942

F = 6731

t = 21 seconds

vi = 0

vf = ?

Formula

F = m * (vf -  vi )  / t

Solution

6731 = 942*(vf - 0)/21          Multiply both sides by 21

6731 * 21 = 942*vf

141351 = 942*vf                   Divide by 942

141351/942 = vf

vf = 151 m/s

6 0
2 years ago
The free-body diagram of a crate is shown. A free body diagram with 4 force vectors. The first vector is pointing downward, labe
satela [25.4K]

The net force acting on the crate is determined as 176 N to the left.

<h3>Net force acting on the crate</h3>

The net force acting on the crate is calculated as follows;

∑F = F1 + F2 + F3 + F4

F(net) = -440y + 176x + 440y - 352x

F(net) = -176 x

The resultant force is pointing in negative x direction.

Thus, the net force acting on the crate is determined as 176 N to the left.

Learn more about net force here: brainly.com/question/14361879

#SPJ1

8 0
2 years ago
Need help on this please
Likurg_2 [28]
Build up of pressure between tectonic plates .
8 0
3 years ago
According to the "Future Potential Source #2: Wind" article, what natural resource does wind power free up
melamori03 [73]
In short, the key value added of CDR data over census or survey approaches is the potential to access current and comprehensive evidence on population size, density, and dynamics, information that is fundamentally necessary for managing any humanitarian emergency or disease-related disaster but which is often
6 0
3 years ago
Other questions:
  • You will begin with a relatively standard calculation.Consider a concave spherical mirror with a radius of curvature equal to 60
    11·1 answer
  • If the amount of gas in a sealed container increases, what happens to the pressure in the container
    10·2 answers
  • What term describes the rate at which charge passes a point in a circuit
    9·2 answers
  • A real object with height of 3.20 cm is placed to the left of a converging lens whose focal length is 90cm. The image is on the
    13·1 answer
  • You walk 60m east and then 20m at 20 degrees south of west. What is your displacement?
    7·1 answer
  • A satellite is orbiting the earth. If a payload of material is added until it doubles the satellite's mass, the earth's pull of
    8·2 answers
  • When a motorcycle picks up speed, its ___________.
    12·2 answers
  • Isaac attempts to kick a field goal from the 40 yard line. He kicks the football at 38 m/s at a 50° angle above horizontal. If t
    8·1 answer
  • What is NOT a benefit of being flexible? easier to do things looser muscles tight muscles less likely to get hurt
    14·1 answer
  • The wave function for a traveling wave on a taut string is (in SI units)
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!