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
Why do we have to watch a video to get answers?
IRINA_888 [86]

Answer:

The videos contain the answers.

Explanation:

4 0
3 years ago
Read 2 more answers
Which option allows users to access the handout master to modify it?
Colt1911 [192]

Answer:

in the school store

Explanation:

4 0
3 years ago
What steps should you take if your harassed online​
AURORKA [14]
Tell an adult and report the person harassing you
8 0
3 years ago
Read 2 more answers
LAST TIME ASKING FOR APPS THAT ARE FREE THAT I DONT NEED TO PAY THE APPS HAVE TO HELP ME STOP VIRUSES FROM MY PHONE PLZ HELP THE
pashok25 [27]

Answer:

i wish i could help u but i cant find a "free" one

Explanation:

4 0
3 years ago
Read 2 more answers
According to the video, what are some hazards Stationary Engineers may face? Check all that apply. noise, hazardous materials, d
NISA [10]

Answer:

noise, hazardous material, burns, electric shocks, moving parts.

Explanation:

i got it right on edge

6 0
3 years ago
Read 2 more answers
Other questions:
  • What setting must be enabled to view data in Demographics and Interests Reports? Content Grouping Advertising features User perm
    13·1 answer
  • A sonar operator on a battleship looks at a display that contains a spatial layout of the distribution of echoes from the surrou
    6·1 answer
  • A0domain indicates that the computer or DNS name does not exist.
    7·1 answer
  • A look to different section of the same page is known as_____.
    7·1 answer
  • When does MMF2 inactivate an Active object? A. When the score is higher than the game's previous high score B. When the player d
    15·1 answer
  • What are some other features of sending attachments in Outlook 2016? Check all that apply.
    9·2 answers
  • If a file you are opening for appending does not exist, the operating system will detect the missing file and terminate the oper
    14·1 answer
  • Each symbol of an octal number corresponds to 3 bits of a binary number. is it true or false​
    5·1 answer
  • D&gt; Windows is the most popular for ​
    11·1 answer
  • *the sticker, available in the middle section of the prescription label, will indicate if the customer requested non-safety caps
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!