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
Which of the following is described as a way engineers can test and investigate how things should be under certain circumstances
goblinko [34]

Answer:

The option that is best described as a way engineers can test and investigate how things should be under certain circumstances is;

  • Modeling

Explanation:

Modeling is a tool an engineer can use for the physical representation of a system that will facilitate the definition, testing and analysis, communication, data generation, data verification and data validation of given concepts

Models also aid in setting specifications, supporting designs, and verification of a given system

Therefore, with modeling engineers can investigate the behavior of systems under given environmental conditions.

3 0
3 years ago
There are three options for heating a particular house: a. Gas: $1.33/therm where 1 therm=105,500 kJ b. Electric Resistance: $0.
sergejj [24]

Answer:

Option ‘a’ is the cheapest for this house.

Explanation:

Cheapest method of heating must have least cost per kj of energy. So, convert all the energy in the same unit (say kj) and take select the cheapest method to heat the house.

Given:

Three methods are given to heat a particular house are as follows:

Method (a)

Through Gas, this gives energy of amount $1.33/therm.

Method (b)

Through electric resistance, this gives energy of amount $0.12/KWh.

Method (c)

Through oil, this gives energy of amount $2.30/gallon.

Calculation:

Step1

Change therm to kj in method ‘a’ as follows:

C_{1}=\frac{\$ 1.33}{therm}\times(\frac{1therm}{105500kj})

C_{1}=1.2606\times10^{-5} $/kj.

Step2

Change kWh to kj in method ‘b’ as follows:

C_{2}=\frac{\$ 0.12}{kWh}\times(\frac{1 kWh }{3600kj})

C_{2}=3.334\times10^{-5} $/kj.

Step3

Change kWh to kj in method ‘c’ as follows:

C_{3}=\frac{\$ 2.30}{gallon}\times(\frac{1 gallon }{138500kj})

C_{3}=1.66\times10^{-5} $/kj.

Thus, the method ‘a’ has least cost as compare to method b and c.

So, option ‘a’ is the cheapest for this house.

 

5 0
3 years ago
Explain why Chloe's design needs to be redone in the following scenario, and recommend the techniques she needs to include in he
Alenkinab [10]

Answer:

She believes he's weak and won't do what needs to be done to become a king.

Explanation:

She says ('I fear thy nature') and calls him 'too full o' th' milk of human kindness' which reflects that she feels his kindness makes him weak and may prevent him from proceeding the plan. Thus, she manipulates him to keep his kindness aside and do what she wishes him to do. She rather belittles him to get her purpose solved and

7 0
3 years ago
Read 2 more answers
What do we need to do to get CO2 emissions all the way to zero?
Svetlanka [38]

Answer:

A key element is powering economies with clean energy, replacing polluting coal - and gas and oil-fired power stations - with renewable energy sources, such as wind or solar farms. This would dramatically reduce carbon emissions. Plus, renewable energy is now not only cleaner, but often cheaper than fossil fuels

Explanation:

here is your answer if you like my answer please follow

3 0
2 years ago
How deep is a 6ft hole?​
Pavlova-9 [17]

Answer:

I know this sounds quite deep but it is as deep as a grave

Explanation:

It's reality

3 0
2 years ago
Read 2 more answers
Other questions:
  • An overhead 25m long, uninsulated industrial steam pipe of 100mm diameter is routed through a building whose walls and air are a
    9·1 answer
  • A device that helps increase field worker productivity by providing reliable location and time
    13·1 answer
  • Consider the cascade of the three LTI systems having impulse responses: h-1(t) = e^-tu(t + 3) h_2(t) = rect((1 -1)/2) h_3(t) = d
    8·1 answer
  • Yellow wood glue will typically also work with metal, glass, and adhesives
    13·1 answer
  • Calculate the resistance of a circuit with 1.5 A and 120 V. Use the appropriate formula from the list of formulas on the
    9·1 answer
  • Most goals
    12·1 answer
  • Christopher has designed a fluid power system that repeatedly gets clogs. Which of the following objects should he choose to add
    13·1 answer
  • Why do engineers play a variety of roles in the engineering process?
    6·1 answer
  • Which of the following maintenance items helps to ensure the vehicles engine lasts as long as possible?
    6·1 answer
  • Assume the availability of an existing class, ICalculator, that models an integer arithmetic calculator and contains: an instanc
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!