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
Margaret [11]
3 years ago
11

javascript Write a function named sumNumbers that accepts a nonnegative number, adds up all of the numbers between 0 and the num

ber (inclusive), and returns the sum.
Engineering
1 answer:
BartSMP [9]3 years ago
5 0

Answer:

  1. function sumNumbers(num){
  2.        let sum = 0;
  3.        for(let i=0; i <= num; i++){
  4.            sum += i;        
  5.        }
  6.        return sum;
  7. }

Explanation:

Firstly, let's create a function named <em>sumNumbers()</em> that take one input parameter, <em>num</em> (Line 1).

Declare a variable,<em> sum</em>, to hold the value of total number between 0 and the input number (Line 2). Initialize it with 0 value.

Create a for-loop to traverse through the numbers started from 0 till input number (Line 3). In the loop, add the each number to<em> sum</em> variable (Line 4).

At last, return the <em>sum</em> as output (Line 6).

You might be interested in
: The interior wall of a furnace is maintained at a temperature of 900 0C. The wall is 60 cm thick, 1 m wide, 1.5 m broad of mat
Snowcat [4.5K]

Answer:

<em>Heat is lost at the rate of 750 J/s or W</em>

<em>The thermal resistance is 1 K/W</em>

Explanation:

interior temperature T_{2} = 900 °C

wall thickness t = 60 cm = 0.6 m

width = 1 m

breadth = 1.5 m

thermal conductivity k = 0.4 W/m-K

outside temperature T_{1} = 150 °C

heat through the wall = ?

The area of the wall A = w x b = 1 x 1.5 = 1.5 m^2

Temperature difference dt = T_{2} - T_{1} = 900 - 150 = 750 °C

note that dt is also equal to 750 K since to convert from °C to K we'll have to add 273 to both temperature, which will still cancel out when we subtract the two temperatures.

To get the heat that escapes through the wall, we use the equation

Q = Ak\frac{dt}{t}

substituting values, we have

Q = 1.5 x 0.4 x \frac{750}{0.6} = <em>750 J/s or W</em>

Thermal resistance R_{t} = \frac{dt}{Q}

R_{t} = 750/750 =<em> 1 K/W</em>

7 0
3 years ago
Component of earthing and reasons why each material is being used<br><br>​
timofeeve [1]

Answer:

The components of earthing are Earth electrode, Main earthing terminals/bars, Earthing conductors, Protective conductors Equipontential binding conductors and Electrically independent electrodes.

3 0
3 years ago
Can someone help me plz!!
pogonyaev
It has to do with mechanical engineering
6 0
3 years ago
thier only motto and goal is to work for society and not make any profits A.small business entreprenuership B.scalable start up
sweet-ann [11.9K]

Answer:

social entrepreneurship

8 0
3 years ago
Read 2 more answers
Find the value of L
KonstantinChe [14]

Answer:

the value is 356732 Volt

6 0
3 years ago
Other questions:
  • I dont undertand this coding problem (Java):
    8·1 answer
  • A 6cm OD, 2cm thick copper hollow sphere [k=386W/m.C] is uniformly heated at the inner surface at a rate of 150W/m2. The outside
    6·1 answer
  • How do I calculate the gear ratio​
    6·1 answer
  • An extruder barrel has a diameter of 4.22 inches and a length of 75 inches. The screw rotates at 65 revolutions per minute. The
    14·1 answer
  • For a very rough pipe wall the friction factor is constant at high Reynolds numbers. For a length L1 the pressure drop over the
    9·1 answer
  • 2 definiciones de personas en Técnicos en ingeniería eléctrica y agregar link.<br> Por favor❗❗❗
    13·1 answer
  • How many astronauts work<br> in the International Space Station
    7·1 answer
  • Andy is a carpenter and wants to make various articles using engineered wood. Which of these wood types can he use?
    8·2 answers
  • What do Engineering Systems achieve?
    8·1 answer
  • Were women treated as equals to men in early aviation history?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!