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
How to prevent water pollution​
loris [4]

Answer:

Here is your answer

Explanation:

1. pick up litter and throw it away in a garbage can.

2. use environmentally household products such as washing powder, household cleaning agents

3. wash your car or outdoor equipment where it can flow to a gravel or grassed area instead of a street.

4. don't throw waste at ocean it will harm the animals and create tocsin.

6 0
3 years ago
The phrase ____ refers to an organization of components that define and regulate the collection, storage, management and use of
Burka [1]

Answer:

A. Database Management System

Explanation:

A Database Management System or DBMS is a set of programs that allow the DB administrator to the information extraction, storage and modification out of a database. It also provides tools to add, erase, modify or even analyze the data within the DB. Some examples of DBMS are MySQL, mongo DB, Ms SQL Server, etc.

3 0
3 years ago
What type of video games do you prefer buying?
Tamiku [17]
Mine is minecraft maybe
6 0
3 years ago
The 16 broad career options developed by the US department of education are called
In-s [12.5K]
The answer is career clusters. 
6 0
3 years ago
The opening of the throttle plate can be delayed as long as
blsea [12.9K]
<h2>I'm trying to adjust the sawtooth throttle on my H. I can open the throttle to 8 notches from the top and it is at the 1815 rated rpm. When I go above that it will overspeed, up to 2500rpm! At the last notch on the quadrant. I have tried the adjustments in the governor, the only thing I have been able to do is set the high rpm screw so it stops at the 8th notch from the top. I should be able to have full use of the quadrant and not go over the 1815 rpm, right? Does anyone have a pic of the throttle linkage under the hood and how to adjust it? I've also tried adjusting the rod in the governor between it and the carb, it is tightened all the way up now. Any ideas what I am missing?</h2>
6 0
3 years ago
Other questions:
  • Software engineering design teams use ________, which are grounded in mathematical concepts of sets and relations, for their sof
    13·1 answer
  • Look up and list the number of a local taxi or car service in your community. Include the company name and telephone number.
    13·1 answer
  • What is the quickest option for adding internet images to a power point presentation
    7·1 answer
  • Gabriel needs to create a formula that does not change when it is copied to cell b2. which formula should he create?
    14·1 answer
  • Write a program that reads in a temperature value in °F. Create a function ConvertFahrenheit that takes that value as a paramete
    7·1 answer
  • If you define a destructor, are you required to define an operator '=' and a copy constructor?
    9·1 answer
  • Visit the quick access toolbar to find help when looking for certain commands. True False
    15·2 answers
  • In java
    6·1 answer
  • Explain
    6·1 answer
  • The entities on which data are collected are _____.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!