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
zhannawk [14.2K]
3 years ago
6

Return the "centered" average of an array of ints, which we'll say is the mean average of the values, except ignoring the larges

t and smallest values in the array. If there are multiple copies of the smallest value, ignore just one copy, and likewise for the largest value. Use int division to produce the final average. You may assume that the array is length 3 or more.centeredAverage({1, 2, 3, 4, 100}) → 3centeredAverage({1, 1, 5, 5, 10, 8, 7}) → 5centeredAverage({-10, -4, -2, -4, -2, 0}) → -3

Computers and Technology
1 answer:
denpristay [2]3 years ago
3 0

Answer:

The code to this question can be defined as follows:

public double centeredAverage(ArrayList<Integer> nums) //defining a method centeredAverage that accepts an array nums

{

   if ((nums == null) || (nums.size() < 3))//define if block for check simple case value

   {

       return 0.0;//return float value

   }

   double sum = 0; //defining a double variable sum

   int smallest = nums.get(0);//defining integer variable and assign value

   int largest = nums.get(0);//defining integer variable and assign value

   for (int i = 0; i < nums.size(); i++) //defining for loop for stor ith value

   {

       int value = nums.get(i);//defining integer value variable to hold nums value

       sum = sum + value;//use sum variable for add value

       if (value < smallest)//defining if block to check value less then smallest

           smallest = value;//hold value in smallest variable  

       else if (value > largest)//defining else if block that checks value greater them largest value

           largest = value; //hold value in largest variable

   }

   sum = sum - largest - smallest;  // use sum to decrease the sum largest & smallest value

   return (sum / (nums.size() - 2)); //use return keyword for return average value

}

Explanation:

In the question, data is missing, that's why the full question is defined in the attached file please find it.

In the given code a method "centeredAverage" is used that accepts an array in its parameter and inside the method, if block is used that checks the cash value if it is true, it will return a float value.

In the next step, two integers and one double variable is defined, that use the conditional statement for check hold value in its variable and at the last use return keyword for return average value.

You might be interested in
Define additional characteristics such as font weight or style for an html tag
Bas_tet [7]
<span>Define additional characteristics such as font weight or style for an html tag:
- attributes</span>
4 0
2 years ago
What is the statement describing? Agile team continuously adapt to new circumstances and enhance the methods of value delivery
Vera_Pavlovna [14]

Answer:

Continuous Integration

Explanation:

In continuous integration process, A program or piece of code is edited, tested and validated by team of software developers or contributors to complete and deploy the single project. This practice will improve the quality and reliability of the code.

Improvement, delivery and deployment are the three different phases, to complete the process of continuous integration.The individuals who contribute in a code or program  in terms of improvement, delivery and deployment make a team that leads to continuous integration.

So, Agile team Continuously adapt Continuous Integration to new circumstances and enhance the methods of value delivery.

8 0
3 years ago
How do i do a mutioutput on a mac
Tcecarenko [31]
Here's what I found

To use an aggregate device with Logic:
Open Logic Pro or Logic Express.
Choose Logic Pro > Preferences > Audio or Logic Express > Preferences > Audio and select the Devices tab.
Select the Output Device drop-down menu and choose the aggregate device from the list. ...
Click Apply Changes at the bottom-right of the window.
4 0
3 years ago
Countries need to engage in trade of natural resources because of distribution in the earth. For instance, countries such as Sau
maks197457 [2]
Water is a scarcity in this area
4 0
3 years ago
98 points possible
joja [24]

A programming language is not used to talk from human to human. It is used to talk from a human to a computer. Computers are very dumb compared to us, so they need to be taught or spoken to in simple terms. Asking them something complex is far beyond their understanding, as they cannot learn anything beyond what has already been taught to them. Using print: “Hello, World” is the way to tell them to do stuff way less complex than when we say ‘write the words Hello, World on the screen’. A programming language is also not very easy to create. Talking to a computer in a dumb way reduces the process to make a new language for the computer to understand.

6 0
3 years ago
Read 2 more answers
Other questions:
  • What is cyberbullying?
    14·2 answers
  • What word describes the complexity of document
    13·1 answer
  • Write a function named printtriangle that receives a parameter that holds a non-negative integer value and prints a triangle of
    7·1 answer
  • Do you think boot-camp-style treatment centers can help young. People kick smartphones addictions?
    14·2 answers
  • When evaluating portable CD players, you consider price, the sound quality, and ease of using the controls. These are your _____
    8·2 answers
  • 1⁰=?<br> Is equal to...........
    12·2 answers
  • A snapshot is most similar to which type of backup scheme
    8·1 answer
  • What is the maximum amount of memory that vmachine1 can use in its current configuration with startup ram set to 1024 megabytes?
    14·1 answer
  • Public classes are accessible by all objects, which means that public classes can be ____, or used as a basis for any other clas
    10·2 answers
  • What are good reasons to do yearly disaster recovery testing? check all that apply
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!