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
A characteristic often associated with entrepreneurship is
FromTheMoon [43]

Answer:

with small businesses

Explanation:

to make a lager profit

3 0
3 years ago
What are Operating Systems?
horrorfan [7]

Answer:

the software that supports a computer's basic functions, such as scheduling tasks, executing applications, and controlling peripherals.

5 0
2 years ago
The following code would include _______.
julia-pushkina [17]

Answer:

Option d is the correct answer for the above question

Explanation:

  • The above question asked about the result of the above question code, which has the query of two tables and their primary key is matched in the where class.
  • The Customer_T table has a primary key "CustomerID" and the Order_T has a foreign key "Customer_ID" and that both are matched in the where clause.
  • So the above query fetches that result in which the records match both the table. Hence Option d is the correct answer for the above question while the other is not because another option is not to get by the result of the above query.
8 0
3 years ago
A que generacion pertenecen los gadgets?
alukav5142 [94]

Answer:

English please

Explanation:

8 0
2 years ago
Consider this query:
vlabodo [156]

Answer:

There is a table in the database named Teacher having columns Email, Expiry Month etc. this query is selecting the email address from the table Teachers on the basis of expiry month that is February.\  

Explanation:

4 0
3 years ago
Other questions:
  • Find every number from 1 to n (inclusive) that is a palindrome which starts with the digit 3. Do not user a helper function.
    10·1 answer
  • 9. What is the difference between a hand-drawn sketch, a working drawing, and a 3D model?
    14·1 answer
  • How can you autohide the taskbar in Windows 10?
    8·2 answers
  • Research and discuss the LAMP (Linux, Apache, MySQL, and PHP) architecture. What is the role of each layer of this software stac
    14·1 answer
  • Last bittttt of points
    8·1 answer
  • Write a valid HTML + Python page that will count numbered from 1 to 1,000,000?​
    9·1 answer
  • Is the flow of power reversible in a leadscrew?
    11·1 answer
  • Why does this website have so many copies of plagiarism?
    5·1 answer
  • Is TCP really more secure than other L4 protocols by default?
    9·1 answer
  • How can i find these services
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!