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]
4 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]4 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
What is Automation ? Please give an example ?
Tcecarenko [31]

Answer:

Creation/application of technology to deliver goods/services with little human effort.

Explanation:

For example, manufacturing technology produces products without much need of human intervention.

6 0
3 years ago
20.
SpyIntel [72]
2Na hope that helps  ^^;
6 0
3 years ago
Read 2 more answers
How to add links in HTML? ​
saveliy_v [14]

Answer:

<a href="url">link text</a>

6 0
2 years ago
A(n ________ cpu has two processing paths, allowing it to process more than one instruction at a time.
Alik [6]
#1) A(n ________ cpu has two processing paths, allowing it to process more than one instruction at a time.
Answer: Multi-core. A multi-core processor is a single computing component with two or more independent actual processing units (called "cores"), which are units that read and execute program instructions. The instructions are ordinary CPU instructions, but the multiple cores can run multiple instructions at the same time, increasing overall speed for programs.
8 0
3 years ago
Read 2 more answers
The keyboard and the mouse are types of BLANK devices
Stolb23 [73]
Input is the right answer.hope it helps.
3 0
3 years ago
Read 2 more answers
Other questions:
  • a. Is there any functional difference between the class being instantiated in the following two ways? Balanced bal = new Balance
    15·1 answer
  • What happens when a filter is applied to a database?
    13·1 answer
  • If some1 emails u and u want to know who it was how do u find that out
    10·2 answers
  • Question 14 (3 points)
    5·1 answer
  • An AM index between 0 and 1 indicates what? a. the AM signal is very small and will not be detected by the receiver b. distortio
    12·1 answer
  • Jeremy is working with a team that is creating an application using attributes and associated methods. What type of programming
    8·1 answer
  • What techniques can be used to assess a product?
    12·2 answers
  • In a well-developed paragraph - using domain-specific vocabulary and academic writing - address the following writing prompt:
    12·1 answer
  • Which Boolean operator enables you to exclude a search term?
    11·1 answer
  • Create a high-level plan to perform a gap analysis for Fullsoft Inc
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!