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
Arlecino [84]
3 years ago
6

Write analgorithm and a C code to calculate the sum and average value of an array12elements.For example: Array_Temperaure=[10, 1

2, 13, 15, 20, 23, 25, 25, 25, 16, 13, 10}

Engineering
1 answer:
Lerok [7]3 years ago
4 0

Answer:

The solution of this code is given below in explanation section.

Explanation:

The C code of this problem is given below

/*******************************************************************************/

#include <stdio.h>

int main()

{

   int n=12, i;//n show the elements in array, while i will be used in for loop

   float Array_Temperaure[]={10, 12, 13, 15, 20, 23, 25, 25, 25, 16, 13, 10};//Array_Temperaure declared and initialized  

   float sum = 0.0;// sum variable declared and initialized

   float avg;// avg average variable declared and initialized

   

   for (i = 0; i < 12; ++i) //for loop to iterate through elements in Array_Temperaure.

   {  

       

       sum += Array_Temperaure[i];// in sum vaiable, Array_Temperaure numbers are added

   }

   avg = sum / n;// average is calculated

   printf("Sum = %.2f", sum);// sum is shown

   printf("\nAverage = %.2f", avg);// average is desplayed.

   return 0;

}

/*************************************************************** algorithm******************/

declare array Array_Temperaure[12];

declare int variable n ,i;

declare float variable sum and average;

for loop

          To iterate n time

                    sum the number of array at current index into total sum

calculate average;

display sum;

display average;

terminate the program;

You might be interested in
A liquid water turbine receives 2 kg / s water at 2000 kPa, 20°C with a velocity of 15 m / s . The exit is at 100 kPa, 20°C, a
sveta [45]

Peppa Pig sjsjssjssjsjsjsjsjssjjsss

3 0
3 years ago
Are currently supporting communities affected by GBV in community violations​
White raven [17]

Answer:By obey peoples propertice

Explanation:

8 0
2 years ago
How is the air delivery temperature controlled during A/C operation?
shepuryov [24]
A IS THE CORRECT ANSWER
3 0
3 years ago
Water enters the pump of a steam power plant as saturated liquid at 20 kPa at a rate of 45 kg/s and exits at 6 MPa. Neglecting t
Natasha2012 [34]

Answer:

\dot W_{in} = 273.69\,kW

Explanation:

The pump is modelled after the First Law of Thermodynamics. A reversible process means that fluid does not report any positive change in entropy:

\dot W_{in} + \dot m \cdot (h_{in}-h_{out}) = 0

The properties of the fluid at entrance and exit are, respectively:

Inlet (Saturated Liquid)

P = 20\,kPa

T = 60.06\,^{\textdegree}C

h = 251.42\,\frac{kJ}{kg}

s = 0.8320\,\frac{kJ}{kg\cdot K}

Outlet (Subcooled Liquid)

P = 6000\,kPa

T = 60.06\,^{\textdegree}C

h = 257.502\,\frac{kJ}{kg}

s = 0.8320\,\frac{kJ}{kg\cdot K}

The power input to the pump is computed hereafter:

\dot W_{in} = \left(45\,\frac{kg}{s} \right)\cdot \left(257.502\,\frac{kJ}{kg} -251.42\,\frac{kJ}{kg} \right)

\dot W_{in} = 273.69\,kW

8 0
4 years ago
: A freeway exit ramp has a single lane and consist of entirely of a horizontal curve with a central angle of 90 degree and a le
Mariana [72]

The design speed was used for the freeway exit ramp is 11 mph.

<h3>Design speed used in the exit ramp</h3>

The design speed used in the exit ramp is calculated as follows;

f = v²/15R - 0.01e

where;

  • v is designated speed

v = ωr

v = (θ/t) r

θ = 90⁰ = 1.57 rad

v = (1.57 x 19.4)/2.5 s

v = 12.18 ft/s = 8.3 mph

<h3>Design speed</h3>

f = v²/15R - 0.01e

let the maximum superelevation, e = 1%

f = (8.3)²/(15 x 19.4) - 0.01

f = 0.22

0.22 is less than value of f which is 0.4

<h3>next iteration, try 10 mph</h3>

f = (10)²/(15 x 19.4) - 0.01

f = 0.33

0.33 is less than 0.4

<h3>next iteration, try 11 mph</h3>

f = (11)²/(15 x 19.4) - 0.01

f = 0.4

Thus, the design speed was used for the freeway exit ramp is 11 mph.

Learn more about design speed here: brainly.com/question/22279858

#SPJ1

4 0
2 years ago
Other questions:
  • Why is my lawn mower not starting?
    9·1 answer
  • The cart travels the track again and now experiences a constant tangential acceleration from point A to point C. The speeds of t
    13·1 answer
  • 21.13 The index of refraction of corundum (Al2O3) is anisotropic. Suppose that visible light is passing from one grain to anothe
    5·1 answer
  • Water enters a tank of diameter Dt steadily at a mass flow rate of m&amp; . An orifice at the bottom with a diameter of Do allow
    11·1 answer
  • The lower yield point for an iron that has an average grain diameter of 1 × 10–2 mm is 230 MPa. At a grain diameter of 6 × 10–3
    9·1 answer
  • An ordinary egg can be approximated as a 5.5-cm-diameter sphere. The egg is initially at a uniform temperature of 8°C and is dro
    6·1 answer
  • A plot of land is an irregular trangle with a base of 122 feet and a height of 47 feet what is the area of the plot?
    13·1 answer
  • What is your favorite RPG game? ( Role Play Game)
    5·2 answers
  • Select three mechanical processes used in the manufacturing phase of engineering.
    11·2 answers
  • Engineers designed a motorcycle helmet from a long-lasting and safe material that protects the wearer from accidents and excessi
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!