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
All of the following can be caused by the movement of geologic plates EXCEPT
Aleks04 [339]
I think storm surges cause fro means world "earth" so a storm surge is like a flood SO plates would cause earth quakes and stuff
8 0
3 years ago
Jake was working on an essay for his English class on a stormy Sunday afternoon. Before he could save his document, a big strike
matrenka [14]

Maybe in atosave, Computers mostly save what your working on :3

8 0
3 years ago
You have just performed a cpm analysis and have found that more than one path through the project network has zero slack values.
Alex787 [66]

Answer:

There are multiple critical paths

Explanation:

The critical path method (CPM), or critical path analysis (CPA), is an algorithm for scheduling a set of project activities. It is commonly used in conjunction with the program evaluation and review technique (PERT). A critical path is determined by identifying the longest stretch of dependent activities and measuring the time required to complete them from start to finish.

The essential technique for using CPM is to construct a model of the project that includes the following:

  •    A list of all activities required to complete the project (typically categorized within a work breakdown structure),
  •    The time (duration) that each activity will take to complete,
  •    The dependencies between the activities and,
  •    Logical end points such as milestones or deliverable items.      

Using these values, CPM calculates the longest path of planned activities to logical end points or to the end of the project, and the earliest and latest that each activity can start and finish without making the project longer. This process determines which activities are "critical" (i.e., on the longest path) and which have "total float" (i.e., can be delayed without making the project longer).

considering the above function of the cpm analysis because you have multiple path, there is tendency that more than path through the project network will have zero slack values.

5 0
3 years ago
The area of the spreadsheet highlighted in red is the _____.
iragen [17]

A spreadsheet is a software application which is used to display numerical data in a tabular form. It has <em>further functions</em> which includes organizing, displaying, calculating data, etc where the data can be viewed at a glance and retrieved from memory.

There are <em>different types</em> of spreadsheet which includes:

  • <u>G00gle Sheet</u>
  • <u>Microsoft Excel</u>
  • <u>LibreOffice</u>
  • <u>Smartsheet,</u> etc.

Data can be arranged in rows and columns.

Please note that your question is incomplete so I gave you a general overview to help you get a better understanding of the concept.

Read more here:

brainly.com/question/22101774

5 0
2 years ago
The process of _____ determines what volume a system can handle by comparing its performance to standards in the industry? horiz
Alina [70]

BENCHMARKING

option C

5 0
3 years ago
Read 2 more answers
Other questions:
  • We want to construct a memory with 256 bytes in capacity. Assume that each byte has a unique address. (a) How many address lines
    14·1 answer
  • Which statement best describes a scientific theory?
    13·1 answer
  • Suppose end system A wants to send a large file to end system B. At a very high level, describe how end system A creates packets
    7·1 answer
  • Recently, your laptop won't power on, and the battery is not charging. You suspect the block on the power cord (also known as a
    5·1 answer
  • To defragment a disk means to ____. slow it down, diagnose problems with it, reorganize it, repair it
    8·1 answer
  • Exchanging which type of data uses the least bandwidth?
    7·2 answers
  • What is DATE data type and its syntax and what is TIMESTAMP data type and its syntax in SQL language.Explain the difference betw
    14·1 answer
  • In which situations would it be most helpful to filter a form? Check all that apply.
    8·1 answer
  • After reading his e-mail messages, Orlando became very frustrated. Many of the messages he received did not conform to netiquett
    6·1 answer
  • Which of the following sentences from the section "The Limits To Free Enterprise With A Mixed Economy" BEST develops a central i
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!