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
Write a Boolean expression that tests if the value stored in the variable num1 is equal to the value stored in the variable num2
Alenkinab [10]

Answer:

num1 = int(input("Enter value: "))

num2 = int(input("Enter value: "))

if num1 == num2:

   print("Equals.")

else:

   print("Unequal.")

Explanation:

6 0
2 years ago
The process of redefining the functionality of a built-in operator, such as , -, and *, to operate on programmer-defined objects
Ksenya-84 [330]

It should be noted that the process of redefining the functionality of a built-in operator to operate is known as <u>operator overloading</u>.

Operator overloading simply means polymorphism. It's a manner in which the operating system allows the same operator name to be used for different operations.

Operator overloading allows the operator symbols to be bound to more than one implementation. It's vital in redefining the functionality of a built-in operator to operate on programmer-defined objects.

Read related link on:

brainly.com/question/25487186

3 0
3 years ago
You want to use your Windows workstation to browse the websites on the internet. You use a broadband DSL connection to access th
xxTIMURxx [149]

Answer:

IP

Explanation:

8 0
3 years ago
Which of the following is an example of intellectual property?
Gnesinka [82]

Answer:

B. Programming code for a video game

Explanation:

An item is considered an intellectual property if it is intangible in the sense that the actual property cannot be touched and it does not have a physical presence.

Options A, C and D do not fall in this category because they are tangible and they have physical presence.

Only option A, programming source code does not fall into this category.

Hence, <em>B. Programming code for a video game </em> answers the question

8 0
2 years ago
Wats is a internal disk drive​
NikAS [45]

Answer: Internal disk drive is the main storage device located in a computer. It usually contains software applications, the operating system and other files.

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Consider the following classes:
    8·1 answer
  • Knowledge flows from the information that has been generated. Which of the following does not necessarily flow from information
    15·1 answer
  • Triangle O N M is cut by line segment L K. Line segment L K goes from side N O to side N M. The length of N L is x, the length o
    8·2 answers
  • #We've started a recursive function below called #measure_string that should take in one string parameter, #myStr, and returns i
    5·1 answer
  • Given the availability of an ifstream object named input, write the other statements necessary to read an integer into a variabl
    6·1 answer
  • Write a algorithm to attend birthday party​
    8·2 answers
  • Radar devices are used by law enforcement to be sure that individuals are driving safely. They tell the officer how fast the veh
    12·1 answer
  • How many pieces can be connected on to a to an SPS​
    11·1 answer
  • Which 1947 Invention paved the way for the Digital Revolution?
    12·2 answers
  • How does a security information and event management system (SIEM) in a SOC help the personnel fight against security threats
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!