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
Decrypt this message: P ht uva h zwf
KatRina [158]
Translation: I am a spy
5 0
3 years ago
Which of the following software programs provides for e-mail communication?. A. Access. B. Word Perfect. C. Outlook. D. Excel
torisob [31]

There are several software programs and internet applications that you use to send electronic mail (e-mail) to other people. However, for programs that are part of the Microsoft Suite, only one provides this ability, which is (C) Outlook.  

Microsoft Access is used to manage databases, while Microsoft Excel is used to analyze numerical and text data. WordPerfect is a word processor software created by Corel.  


5 0
2 years ago
Read 2 more answers
Which type of interview is conducted in a format where the interviewee is questioned and presented to a panel of individuals?
tester [92]
The <span>type of interview is conducted in a format where the interviewee is questioned and presented to a panel of individuals is called "Panel Interview." The interviewee is surrounded with 2 or more panelists that will ask questions that you need to answer.</span>
3 0
3 years ago
Read 2 more answers
A student is helping a friend with a home computer that can no longer access the Internet. Upon investigation, the student disco
Firlakuza [10]

Answer:

Option (D) is the right answer.

Explanation:

DHCP term used as a short form of dynamic host configuration protocol, which is used to assigns the IP address automatically according to the network.

According to the scenario, the system is getting the wrong IP address that resulting in internet disconnection which is a failure of the DHCP server because it is responsible for assigning the right IP address to the system.

Hence option (D) is the most appropriate answer.

While other options are wrong because of the following reasons:

  • Static IP is the type of IP address which is fix and doesn't change in the system after rebooting, hence it has no connection in the change of IP address.
  • If the DHCP server is working well there is no chance of interference from the surrounding device.
  • Network setting has no connection with computer power supply as SMPS is used to give power and boot system only.
8 0
3 years ago
Identify two entities and 2 of their attributes from the given scenario.
polet [3.4K]

Bookstore and BookSearch are the two entities for the given scenario.

Explanation:

  • For the given Book.com virtual store, there can be two entities like Bookstore and BookSearch.
  • Bookstore can have all the details of the books in the virtual store. hence the attributes can be
  • Bookstore attributes: bookname, Authorname, Publisher, Publishedyear, Agegroup, category.
  • BookSearch entity can be used to search the books in the virtual store.
  • Booksearch attributes: bookname, category, bookid, authorname.
8 0
3 years ago
Other questions:
  • Data is: a. Information endowed with relevance and purpose b. Set of specific objective facts or observations c. Some informatio
    10·1 answer
  • How many buttons does a gamecube controller have?
    7·1 answer
  • True false you cannot fill in a callout​
    14·1 answer
  • keeping in mind the role in order of precedence plays in equations, what would excel display as the result of the following equa
    14·1 answer
  • What do you need to do before you can sort and filter data in a data base?
    12·1 answer
  • what program searches the Internet for specified keywords and returns a list of the pages where the keywords were found
    6·1 answer
  • How to add a bill using the reciept capture?
    7·1 answer
  • I really need help in this!!!
    11·1 answer
  • How is the architecture converted into software code? Elaborate the steps its passes through with help of examples / Diagram.
    15·1 answer
  • Is orgenized maningful and useful data​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!