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
Whitepunk [10]
2 years ago
10

Iven an array temps of double s, containing temperature data, compute the average temperature. Store the average in a variable c

alled avgTemp. 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 .
k = 0;
total = 0;
while (k < temps.length)
{
total = total + temps[k];
k++;
}

avgTemp = total / (temps.length);
Computers and Technology
1 answer:
ale4655 [162]2 years ago
6 0

Answer:

import java.util.Arrays;

import java.util.Scanner;

public class num1 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter length of the array:");

       int len = in.nextInt();

       double [] temps = new double[len];

       double avgTem;

       int k =0;

       double total = 0;

       for( k=0; k<temps.length; k++){

           System.out.println("Enter values for the array");

           temps[k]=in.nextDouble();

       }

       System.out.println("The Arrays contains the following values");

       System.out.println(Arrays.toString(temps));

       // Computing the average of the values

       for(k=0; k<temps.length; k++){

           total = total+temps[k];

       }

       avgTem = total/(temps.length);

       System.out.println("The average Temperature is: "+avgTem);

   }

}

Explanation:

  • Using Java programming language
  • Import the Scanner class to receive user input
  • Prompt User for the length of the Array, receive and store in a variable len;
  • Declare a new double array of size len double [] temps = new double[len];
  • Using a for loop, continually prompt user to enter values into the array
  • Display the values of the array using Java's Arrays.toString method
  • Use another for loop to add up all the elements in the arraay and store in the variable called total
  • Outside the second for loop calculate the average avgTem = total/(temps.length);
  • Display the average temp.
You might be interested in
Perform depth-first search on each of the following graphs; whenever there's a choice of vertices, pick the one that is alphabet
Vikki [24]

Answer:

See the table attached for complete solution to the problem.

7 0
3 years ago
Which is a software application used to analyze an organization’s data to improve decision making?
Ostrovityanka [42]

The software application used to analyze an organization’s data to improve decision making is said to be Business intelligence software.

<h3>What is Business intelligence?</h3>

Business intelligence is known to be a kind of app that has been set up and it is known to have a set of data analysis applications that has been made to meet a lot of information needs.

Business intelligence are known to be a kind of procedural and technical input that takes , stores, and analyzes the data made by a company's activities.

Learn more about Business intelligence from

brainly.com/question/13339276

3 0
1 year ago
Explain what might happen if two stations are accidentally assigned the same hardware address?
Firdavs [7]

Answer: If two different station are addressed with the same hardware address then there are chances of occurrence of the failure in the network at irregular intervals.The failure or error will occur because of the both the devices are seen as one by the network due to same address.

An intelligent network system id used ,it can identify the error can help in the prevention of the failure.Other option for configuring the situation is assigning the MAC(media access control)address to devices which are unique in nature thus, no device can have same address.

5 0
3 years ago
Consider the following language:
VMariaS [17]

L is a decidable language because the Turing machine accepts it.

L is a recognizable language if  TM M recognizes it.

<h3>How do you know if a language is decidable?</h3>

A language is said to be decidable only when there seems to exists a Turing machine that is said to accepts it,

Here, it tends to halts on all inputs, and then it answers "Yes" on words that is seen in the language and says "No" on words that are not found in the language. The same scenario applies to recognizable language.

So,  L is a decidable language because the Turing machine accepts it.

L is a recognizable language if  TM M recognizes it.

Learn more about programming language from

brainly.com/question/16936315

#SPJ1

8 0
1 year ago
Data entry is the process of getting information into a database. true false
Keith_Richards [23]
Yes it's the process of entering data into a database.
6 0
3 years ago
Read 2 more answers
Other questions:
  • The number of bits used to store color information about each pixel is called ____.
    13·1 answer
  • Which of the following is an unintended consequence of pesticide use on crops?
    10·1 answer
  • What are the four primary factors described in the text that set the state for Web 2.0 or the social Web that we enjoy today??
    12·1 answer
  • Smart art can be used to create _____that highlights relationships betweeen two items
    8·2 answers
  • What lets you do many things, like write book reports and stories?
    15·1 answer
  • Blender is used by which video game team member?
    15·1 answer
  • Self-confidence, blank, and communication are key factors to building positive relationships. Fill in the blank with a 13 letter
    5·1 answer
  • The sun emits invisible _____&gt; A) electromagnetic waves B) Waves C) Radiation D) Wavelength E) Ultraviolet Light
    8·1 answer
  • The hexadecimal eqquivalent of (80)10 is
    11·1 answer
  • How does Virtual Reality help to make work experiences more inclusive?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!