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
A pendulum on earth swings with angular frequency ω. On an unknown planet, it swings with angular frequency ω/ 4. The accelerati
Afina-wow [57]

Answer:

g / 16

Explanation:

T = 2π \sqrt{\frac{l}{g} }

angular frequency ω = 2π /T

= \sqrt{\frac{g}{l} }

ω₁ /ω₂ = \sqrt{\frac{g_1}{g_2} }

Putting the values

ω₁ = ω ,     ω₂ = ω / 4

ω₁ /ω₂ = 4

4 =  \sqrt{\frac{g}{g_2} }

g₂ = g / 16

option d is correct.

6 0
3 years ago
A merry-go-round with a a radius of R = 1.9 m and moment of inertia I = 209 kg-m2 is spinning with an initial angular speed of ω
RideAnS [48]

Answer:

340.67 kgm²/s

Explanation:

R = Radius of merry-go-round = 1.9 m

I = Moment of inertia = 209 kgm²

\omega_i = Initial angular velocity = 1.63 rad/s

m = Mass of person = 73 kg

v = Velocity = 4.8 m/s

Initial angular momentum is given by

L=I\omega_i\\\Rightarrow L=209\times 1.63\\\Rightarrow L=340.67\ kgm^2/s

The initial angular momentum of the merry-go-round is 340.67 kgm²/s

8 0
3 years ago
Which statements below are true?
Ilya [14]

The correct statements are that the speed decreases as the distance decreases and speed increases as the distance increases for the same time.

Answer:

Option A and Option B.

Explanation:

Speed is defined as the ratio of distance covered to the time taken to cover that distance. So Speed = Distance/Time. In other words, we can also state that speed is directly proportional to the distance for a constant time. Thus, the speed will be decreasing as there is decrease in distance for the same time. As well as there will be increase in speed as the distance increases for the same time. So option A and option B are the true options. So if there is decrease in the distance due to direct proportionality the speed will also be decreasing. Similarly, if the distance increases, the speed will also be increasing.

7 0
3 years ago
Which term describes the time it takes for an object to complete one full cycle of motion on a spring?
Sav [38]

The term period (symbol: T) describes the time it takes for an object to complete one full cycle of motion on a spring.

The formula for time is: T  = 1 / f , where f is the frequency  , f= c / λ = wave speed c (m/s) / wavelength λ (m)..

The formula describes that as the frequency of a wave increases, the time period of the wave decreases.

4 0
3 years ago
Read 2 more answers
A 0.050 kg bullet strikes a 5.0 kg stationary wooden block and embeds itself in the block. The block and the bullet fly off toge
natka813 [3]

Answer: 909 m/s

Explanation:

Given

Mass of the bullet, m1 = 0.05 kg

Mass of the wooden block, m2 = 5 kg

Final velocities of the block and bullet, v = 9 m/s

Initial velocity of the bullet v1 = ? m/s

From the question, we would notice that there is just an object (i.e the bullet) moving before the collision. Also, even after the collision between the bullet and wood, the bullet and the wood would move as one object. Thus, we would use the conservation of momentum to solve

m1v1 = (m1 + m2) v, on substituting, we have

0.05 * v1 = (0.05 + 5) * 9

0.05 * v1 = 5.05 * 9

0.05 * v1 = 45.45

v1 = 45.45 / 0.05

v1 = 909 m/s

Thus, the original velocity of the bullet was 909 m/s

3 0
3 years ago
Other questions:
  • Two male moose charge at each other with the same speed and meet on a icy patch of tundra. As they collide, their antlers lock t
    15·2 answers
  • In the 2016 Olympics in Rio, after the 50 m freestyle competition, a problem with the pool was found. In lane 1 there was a gent
    5·1 answer
  • Who is the president of Africa
    10·2 answers
  • The equation T^2=A^3 shows the relationship between a planet’s orbital period, T, and the planet’s mean distance from the sun, A
    5·1 answer
  • Which fallacy is committed in the following argument?
    11·1 answer
  • PLEASE The weight of a girl  is  600 N and the area of her one foot is        50 cm². What will be the pressure exerted by her o
    13·1 answer
  • Is Radioactive decay a way to find the relative age of a rock?<br><br> True<br> False
    14·1 answer
  • A dart with a mass of 0.5kg is thrown at 15m/s and sticks into a 1kg apple hanging
    14·1 answer
  • The periodic table is an arrangment of the chemical elements, ordered by atomic number, into families, and by doing so illustrat
    13·1 answer
  • 1. At a local salon called Curl up and Dye a woman has mysteriously become
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!