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
8.2 code practice edhesive?
Illusion [34]

Answer:

temperatures = []

i = 0

while i < 5:

   try:

       t = int(input('Enter a temperature: '))

       temperatures.append(t)

       i += 1

   except ValueError:

       print('Enter a number')

print(temperatures)

Explanation:

Hope this helps!

6 0
3 years ago
Why is the radial gradient type a good choice for the grapes?
Grace [21]
<span>when you use the radial gradient fill it gives it a look like a shine on them. </span>
3 0
3 years ago
Read 2 more answers
Technician A says that volatility describes how hard it is for gasoline to evaporate. Technician B says that Reid vapor pressure
Lubov Fominskaja [6]

I’d say both techies are correct.

Volatility, as applied in gasoline, is quantified by the tendency of the liquid to change to vapor at any given temperature (vaporize). This rate of change might be hard or easy, this depends on the temperature or the pressure. Technician B is also correct. RVP is defined and determined experimentally according to the ratio of the vapor volume to the liquid volume at 100 °F.

8 0
3 years ago
I know that this will be taken down for not being a real question but is anyone else not able to search for anything? I can type
Schach [20]

Answer:

Sameee

Explanation:

6 0
3 years ago
What is the next step Charlie should take to solve the problem
Arada [10]

Answer:

I don't know what the problem is for Charlie to solve so can you put it in the ch.at so I can answer it from there

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Pressing the e key while in edit mode will exit the interaction mode<br><br> true<br><br> false
    7·1 answer
  • What helped Taylor through her tough time with being bullied
    7·1 answer
  • Microsoft words spell checker
    9·1 answer
  • Use the ________ property in the html link tag to to associate a web page with a style sheet for printing.
    5·1 answer
  • . Describe a way to simplify a complex problem.
    8·1 answer
  • Why do chloroplasts appear only in plant cells and lysosomes appear only in animal cells?
    13·1 answer
  • Which of the following is a characteristic of vector graphics?
    15·2 answers
  • In how many ways can a list of students names from your class be organized?​
    14·1 answer
  • What are the two protocols used most often with iot devices? (select two. )
    10·1 answer
  • What do you mean by computer ethics?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!