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
3–102 One of the common procedures in fitness programs is to determine the fat-to-muscle ratio of the body. This is based on the
gayaneshka [121]

Answer:

x_fat = [ 0.5*(Wsa + Wsw) -  p_muscle*V ] / V*( p_fat - p_muscle )

Explanation:

Given:

- The total volume of body = V

- The average density of the body = p_avg

- The density of muscle = p_muscle

- The density of fat = p_fat

Find:

Obtain a relation for the volume fraction of body fat x_fat

Solution:

- The volume of the fat is given by:

                          V_fat = x_fat*V

- The volume of the muscle is given by:

                          V_muscle = V - V_fat

                                            = V - x_fat*V

                                            =V*( 1 - x_fat )

- We will use the conservation of mass for the body related as:

                         mass_fat + mass_muscle = Total average mass

                         p_fat*V_fat + p_muscle*V_muscle = p_avg*V

                         p_fat*x_fat*V + p_muscle*V*( 1 - x_fat ) = p_avg*V

                         p_fat*x_fat + p_muscle*( 1 - x_fat ) = p_avg

- To determine p_1 we weigh the body in air:

                         Weight reading (Wsa) = m = p_1*V

                         p_1 = Wsa / V*g

- To determine p_2 we weigh the body in water:

                         Weight reading (Wsw) = m - p_w*V= p_1*V - p_w*V

                         Weight reading (Wsw) = V*(p_1 - p_w) = V*(p_2)

                         Where, p_2 = p_1 - p_water

                         p_2 = Wsw / V

- The average density p_avg:

                         p_avg = 0.5*(p_1 + p_2)  

                         p_avg = 0.5*(Wsa / V + Wsw / V)  

                         p_avg = 0.5*(Wsa + Wsw) / V                      

- Plug in the mass equation:

                         p_fat*x_fat + p_muscle*( 1 - x_fat ) = 0.5*(Wsa + Wsw) / V

                         x_fat*( p_fat - p_muscle ) = 0.5*(Wsa + Wsw) / V - p_muscle

                   x_fat = [ 0.5*(Wsa + Wsw) -  p_muscle*V ] / V*( p_fat - p_muscle )

                         

6 0
4 years ago
Why must air tanks be drained​
Jobisdone [24]
Water can freeze in cold weather and cause brake failure.
7 0
3 years ago
Where is the Volkswagen super factory located? how is this locate relevant to us?​
Blizzard [7]
It’s in Wolfsburg Germany
4 0
3 years ago
Assign deliveryCost with the cost (in dollars) to deliver a piece of baggage weighing baggageWeight. The baggage delivery servic
Sholpan [36]

Answer: y = x * 1dollars - 30dollars

Explanation:

Giving that the delivery cost in dollar is potent for all x > = 50 pounds of wght

Y = (x - 50)*1 dollar + c ...equ 1

Y = delivery cost equation in dollars

x = weigt of baggage for delivery

c = 20dollars = down payment for the first 50 pound weight of baggage

Equ 1 becomes

Y = (x)dollars - 50 dollars + 20 dollars

Y = (x) dollars -30 dollars

4 0
4 years ago
Which of these physical concepts is most important in civil engineering?
mezya [45]

Answer:

Option A (energy transformations) is the correct solution.

Explanation:

  • Energy has become a local matter that has been primarily described as the commitment to deal as well as to generate heat. There are several other power sources, which can either be transferred or transformed to several other renewable technologies.  
  • This same fundamental law defined that the energy required including its universe has been corrected and therefore that energy is being generated as well as severely damaged but should only be moved from one location to the next.

Those certain possibilities are not connected to the circumstance in question. And therefore this answer seems to be the correct one.

3 0
3 years ago
Other questions:
  • Draw the hierarchy chart and then plan the logic for a program needed by Hometown Bank. The program determines a monthly checkin
    8·1 answer
  • There are a number of requirements that employers must do to protect their workers from caught-in or
    12·1 answer
  • Engine blocks are made by using a manufacturing process called​
    12·1 answer
  • What is the name of the part that supports the headlight assembly?
    15·1 answer
  • Giving out 100 coins cuz why not?​
    11·1 answer
  • Technician A says that to depressurize high-pressure components of the electronic brake control (EBC) system, research the proce
    13·1 answer
  • While reflecting on the solutions and the process of concept generation, the development team takes a look at some critical ques
    10·1 answer
  • Complex machines are defined by
    8·1 answer
  • If a population has no predadors and plenty of available resources, how might that population change
    15·1 answer
  • Is reinforcement needed in a retaining wall
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!