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
Under which menu would you be able to see the number of continuous track minutes available on each mounted hard drive at the cur
Crazy boy [7]

Answer:

looooollll

Explanation:

yooooooooo u good

3 0
1 year ago
List 1 reason people invest in Cryptocurrency
Katarina [22]

Answer:

The common reason to invest in cryptocurrency is the desire for a reliable, long-term store of value.

Explanation:

8 0
2 years ago
WHO WANTS TO PLAY AMONG US
Elza [17]

Answer:

Explanation:

ME

8 0
3 years ago
Read 2 more answers
Which term refers to the data stored in computer memory on which the processor applies to program instructions
Fed [463]
The answer is B.) variable.
3 0
3 years ago
In what way are a coffee maker and a dishwasher the same?<br><br>BY THE WAY THIS IS TEENBIZ
weeeeeb [17]
They both need electricity. Both used in the kitchen.
3 0
2 years ago
Read 2 more answers
Other questions:
  • Create a jQuery ready listener that updates the options within the element with ID toCurrency such that: The first element is: S
    12·1 answer
  • When was the federal commission act put into effect?????
    13·1 answer
  • Which route of entry could chemicals use to enter through the body’s airways?
    8·1 answer
  • Compile and Execute a Program
    13·1 answer
  • Can someone find out what this binary number thing is. Just find out the message, I'm having a difficult time
    13·1 answer
  • A period in which unemployment is low, business produces many goods and services, and wages are good is called ______.
    8·1 answer
  • What code would you use to create the login button?
    11·1 answer
  • You're making great progress on your assignment. You've defined the purpose of your message, identified both the primary and sec
    9·1 answer
  • Can a dod activity enter into a service contract for a military flight simulator without getting a waiver from the secretary of
    13·1 answer
  • Where can i make a 3d animation for free ( pls don't trick me)
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!