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
Because we allow everyone full control, how do you make sure that the shared files are secure?
alina1380 [7]
Make private accounts on defiant servers
4 0
4 years ago
After a normal system shutdown, when the computer is turned off, contents of the memory used to store bios settings are
kiruha [24]
The settings are retained

<span>Technically, Bios software is stored in a non-volatile ROM (Read-Only Memory) chip found on the motherboard.  Usually, this kind of chip retains its contents even after a normal system shutdown. Rom chips contains programs that are collectively referred to as BIOS chip or Basic Input/Output Services</span>
8 0
3 years ago
Read 2 more answers
In his article, “How to Publish Without Perishing,” what does James Gleick believe most people do when they really read a book?
jonny [76]

Answer:

James Gleick believes that they immerse themselves in a rich textual world. The answer is C.

3 0
3 years ago
Read 2 more answers
When a customer makes an online hotel booking the database is updated by using
Valentin [98]
I think it’s a form,if wrong please don’t be mad
4 0
3 years ago
Read 2 more answers
In Python, how would you print the first 4 characters of "Help me pass!"
Semenov [28]

Answer:

sample_str = "Help me pass!"

first_chars = sample_str[0:4]

print('First four character: ', first_chars)

Explanation:

sample_str = "Help me pass!"

first_chars = sample_str[0:4]

H has index 0, e has index 1, l has index 2, p has index 3. the space has an index as well, etc.

7 0
2 years ago
Other questions:
  • Social networking sites like Office Online, PayPal, and Dropbox are used to develop social and business contacts.
    6·2 answers
  • Which part of the faucet is the aerator?
    13·1 answer
  • A potential threat to administrators’ ability to manage the correctional system is
    12·1 answer
  • Which of the following is the net effect of the following combination of share and NTFS permissions when the share is accessed o
    7·1 answer
  • Solve the following equations and check your result 1) 3x=2x+18​
    5·2 answers
  • Explain the<br>4 ways<br><br>ways of arranging icons.<br><br>​
    6·1 answer
  • Compare the two items in a summary of qualifications taken from a resumé. Which is better?
    9·1 answer
  • Select three advantages of cloud computing.
    10·1 answer
  • What are three ways a person may use a computer without realizing it?
    9·1 answer
  • Do you want my hero academia?<br><br><br><br><br><br> if so, who's your favorite character :&gt;
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!