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
Art [367]
3 years ago
14

Given an array temps of doubles, containing temperature data, compute the average temperature. Store the average in a variable c

alled avgTemp, which has already been declared. Besides temps and avgTemp, you may use only two other variables -- an int variable k and a double variable named total, which have been declared .
Computers and Technology
1 answer:
oksian1 [2.3K]3 years ago
4 0

Answer:

#include <iostream>

using namespace std;

int main() {

   double temps[10]={32.2,30.1,33.5,32.8,35.0,36.7,36.8,35.6,34.9,36.9};//initialized 10 temps values.

   double avgTemp,total=0;//two varaibles declared.

   for(int k=0;k<10;k++)//for loop to calculate the average..

   {

       total+=temps[k];//adding temperature values to the total..

   }

   avgTemp=total/10;//calcualting the average..

   cout<<"The average temperature is "<<avgTemp<<endl;//printing the average temperature.

return 0;

}

Output:-

The average temperature is 34.45.

Explanation:

The above written code is in C++. An array of double temps is initialized with arbitrary 10 values.Then the average is calculated using the integer k and the average is stored in the variable avgTemp. Then it is printed on the screen.

You might be interested in
Which quality allows programmers to modify a program as and when required
lana66690 [7]
I think Flexibility. Because when you are flexible you are able to manage things at anytime.
5 0
3 years ago
Read 2 more answers
A computer is a multipurpose device that accepts input processes data and produces output all according to a series of stored
yulyashka [42]
According to a series of stored procedures 
8 0
3 years ago
True or false
Semmy [17]
It’s false I hope this helped you
3 0
3 years ago
Evolution of management​
Alex Ar [27]

Answer:

Evolution of Management and Evolution of Management Science. ... Evolution of the management thought is a process that began in the earlier days of humans. It began when the man found the need to live in the groups. Then, mighty men soon organized the masses and distributed them among the groups.

Explanation:

HOPE IT HELPS

6 0
3 years ago
Read 2 more answers
Do u like five nights at Freddy's? and is it good or bad?​
Murljashka [212]

Answer:

its bad

Explanation:

6 0
3 years ago
Read 3 more answers
Other questions:
  • What are the advantages of repeating a header row? check all that apply
    14·1 answer
  • Help me please (program c++)
    11·1 answer
  • A cloud file system (CFS) allows users or applications to directly manipulate files that reside on the cloud.
    6·1 answer
  • Jamal is creating a presentation for a report on engineers. He wants to use a template. How can he access different options for
    14·1 answer
  • I need help fixing this please
    6·2 answers
  • Maya is preparing a presentation for her science class on how solar panels produce energy. Why would a
    11·2 answers
  • What will be the range of the random numbers generated by the following code snippet? rand() % 50 + 5;
    14·1 answer
  • Perceptron simplest definition
    14·1 answer
  • In addition to reduced power consumption, what is an advantage of using hyperscale cloud computing data centers?
    8·1 answer
  • Can someone make me a natural selection comic but only 5 same thing in the example pic but draw the animal different and a diffe
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!