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
Alex_Xolod [135]
4 years ago
11

write a program that takes 10 numbers as input and displays the mode of the numbers using parallel arrays and a method that take

s an array of numbers as a parameter and returns the value that appears most often in the array
Computers and Technology
1 answer:
irina [24]4 years ago
4 0

Answer:

The Java program is explained below

Explanation:

public class ArrayMode {

  public static int mode(int arr[]) {

      int maxValue = 0, maxCount = 0;

      for (int i = 0; i < arr.length; ++i) {

          int count = 0;

          for (int j = 0; j < arr.length; ++j) {

              if (arr[j] == arr[i])

                  ++count;

          }

          if (count > maxCount) {

              maxCount = count;

              maxValue = arr[i];

          }

      }

      return maxValue;

  }

  public static void main(String args[]) {

      int arr[] = { 9, 5, 3, 8, 5, 12, 19, 5, 11 };

      System.out.println("The set of numbers are: ");

      for (int i = 0; i < arr.length; i++)

          System.out.print(arr[i] + " ");

      System.out.println("\nThe mode of the set is: " + mode(arr));

  }

}

You might be interested in
Write a method named numUnique that accepts a sorted array of integers as a parameter and that returns the number of unique valu
SVEN [57.7K]

Answer:

The method in Java is as follows:

public static int numUnique(int list[]) {  

int unique = 1;  

for (int i = 1; i < list.length; i++) {  

 int j = 0;  

 for (j = 0; j < i; j++) {

  if (list[i] == list[j])  

   break;  

 }

 if (i == j)  

  unique++;  

}  

return unique;  

}  

Explanation:

This line defines the numUnique method

public static int numUnique(int list[]) {

This initializes the number of unique elements to 1

int unique = 1;  

This iterates through the list

for (int i = 1; i < list.length; i++) {

The following iteration checks for unique items

 int j = 0;  

<em>  for (j = 0; j < i; j++) { </em>

<em>   if (list[i] == list[j]) </em><em>If current element is unique, break the iteration</em><em> </em>

<em>    break;  </em>

<em>  } </em>

 if (i == j)  

  unique++;  

}

This returns the number of unique items in the list

return unique;  

}  

3 0
3 years ago
-What is/are the goal/s of Business Intelligence systems?
8_murik_8 [283]

Answer: Business intelligence system is a system that is used in the field of business and organizations for generations of the strategy and plans to make decision. This system consist of the business intelligence(BI) tools. It creates a connection in the different information/data and takes them to the business organization.

Business intelligence system has goals like:-

  • Increasing daily sales
  • Fast the growth rate of the business
  • improving the rental performance
  • Gaining more profit

5 0
3 years ago
Please help me asapppp!​
pychu [463]

of which class is this question

6 0
3 years ago
Read 2 more answers
In most software programs, which color arrows selects the points in a vector
Inessa05 [86]

Answer:

in think gray is used as arrow color which selects the points in a vector

4 0
3 years ago
Renée’s job entails using a company laptop to constantly open other peoples’ workbooks, sorting the data, importing a new sheet
nevsk [136]

she should leave and go somewhere else for a mminute to cool and then come backa nd close tabs.

6 0
3 years ago
Other questions:
  • What are two great ways to find clues to locate commands on the ribbon?
    13·1 answer
  • to create a cover letter to send to a potential employers along with a resume what software program should you use
    10·1 answer
  • True or false. Embedding only part of a font is called presetting.
    14·1 answer
  • When you’re in the Normal view, what are the visible panes?
    15·2 answers
  • What is the best explanation for why digital data is represented in computers in binary?
    10·1 answer
  • Amazon Web Services and Microsoft Azure are some of the most widely used _______.
    7·1 answer
  • Write a program that prompts the user to enter three cities and displays them in ascending order. Here is a sample run: Enter th
    8·1 answer
  • Calculator is an example of
    14·1 answer
  • Weaknesses about ICT Technician
    9·1 answer
  • Which of the following is one of the tools used by a Python IDE that helps prevent syntax errors?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!