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
It is not possible to use keywords to search for themes. true or false.
Drupady [299]
False my dude .........................
3 0
3 years ago
which is the quickest way to change the font color in multiple, randomly located cells in a worksheet?
insens350 [35]
First select or highlight the rows or columns that you want to change the font color<span>. You can hold the ctrl key while select </span>multiple cells<span>. After, selecting you can now </span>change the font color<span> of everything you selected.</span>
6 0
3 years ago
Read 2 more answers
Please help me, I honestly dont know what happened to my laptop.
Alex787 [66]
Restart the whole computer??
7 0
3 years ago
Read 2 more answers
Horizontal and vertical flips are often used to create ___.
mixer [17]

Answer:

Rotation of an image

Explanation:

The correct answer is -  Rotation of an image

Reason -

When you rotate an object, it moves left or right around an axis and keeps the same face toward you.

When you flip an object, the object turns over, either vertically or horizontally, so that the object is now a mirror image.

5 0
3 years ago
Which of the following is NOT a characteristic developed by New Journalism?
krok68 [10]
Flashy page layouts
7 0
3 years ago
Other questions:
  • A table with a width set to 600 pixels will look ________ on a monitor with resolution set to 640 × 480 than on a monitor with r
    10·1 answer
  • Tommy has hired a marketing company to create a billboard advertisement
    11·2 answers
  • Which part of a window lets you see a fileâs contents without opening the file?
    9·1 answer
  • Okay so remember that page I was advertising? At: fol ? Now it's deleted. And idk why because I was doing everything the right w
    7·1 answer
  • Create a Rational number class in Java using the same style as the Complex number class created in class.(The in class example c
    12·1 answer
  • IPhone + iPad + iPod + iPod touch + iMac + MacBook + iBook + Apple =???
    11·2 answers
  • Y'+2y = 5-e^(-4x), y(0)=-11
    9·1 answer
  • The __________ statement allows you to check for
    7·1 answer
  • Does anybody play nba2k21 On ps4
    8·2 answers
  • The quickest way to change a word is to double
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!