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
Which type of communication protocol converts data into standard formats that can be used by applications?
larisa86 [58]
<span>Arrival protocols are the type of data protocols that convert data into standard formats that can be used by applications, such as email, Web browsers and Skype</span>
8 0
3 years ago
After running a Google Search Ads campaign for several months, Meredith notices sales of her advertised products are starting to
lesya692 [45]

Answer:

The campaign could be improved by 78% if the listed recommendations are followed.

Explanation:

While conducting the following Search advertising program for a few months, Meredith has announced that revenues of its branded goods are beginning to slow. She reviews her Google Advertising Suggestions webpage which states that her campaign's performance ranking is 22 points.

Thus, the campaign will be increased by 78% if the above recommendations are implemented to inform Meredith regarding its Google Search Advertising plan.

5 0
2 years ago
The next elected president should be someone who can be very nice, kind, stick-up for him/herself, and take care of the people w
PSYCHO15rus [73]

Answer:trump

Explanation:

3 0
2 years ago
Read 2 more answers
Which type of software is created and updated by a worldwide community of programmers and is available for​ free?
Ede4ka [16]
Open source is created and updated by a worldwide community of programmers and is available for​ free. Many students are in luck, as they can easily study publicly accessible codes and have a possibility to make better software. It also has lots of advantages, such as getting <span>high-quality results when the source code is passed around, tested and fixed.The most important thing - it<span> is a valuable learning opportunity for programmers and opportunity to improve their skills.</span></span>
5 0
3 years ago
In Bash, what commands can you use to view the contents of a document?
AlekseyPX

You can use the cat and less command to view the contents of a file.

hope this helps! :)

8 0
1 year ago
Other questions:
  • When you see ##### in a cell, you should A. increase the cell width. B. increase the cell height. C. decrease the cell width. D.
    14·1 answer
  • What would be some long- term goals.
    11·1 answer
  • A layer of control in each communicating device that provides functions such as flow control, error detection, and error control
    13·1 answer
  • 1. Which of the following is NOT an example of systems software? (Points : 1)
    5·2 answers
  • A Windows application which demands a lot of raw processing power to execute repetitive complex calculations is a good candidate
    9·1 answer
  • A user is trying to delete a file located on an ntfs volume on his windows 8 computer but is unable to do so. Why is this.
    5·1 answer
  • True or false: The objective of an Enterprise Resource Planning (ERP) system is to create a customized software program that int
    10·1 answer
  • he degree of operating leverage is equal to: Group of answer choices FC / OCF. VC / OCF. 1 FC / OCF. 1 VC / OCF. 1 Picture FC /
    9·1 answer
  • Some scientists say that robots my become self - aware in the near future Do you think this is possible?​
    10·1 answer
  • How should excel Identify social security numbers: as a text, numbers, or date and time? Why?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!