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]
3 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]3 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
Question #2: How would you demonstrate professionalism in a video call with a teacher? Edmentum Digital world Please Help!!
Stella [2.4K]

Answer:

good luck getting an answer then

Explanation:

5 0
2 years ago
Using caller id is part of which step in an effective time management plan
timurjin [86]
The answer is avoid distractions.  <span>Using caller id is part of  step to avoid distractions in an effective time management plan.  </span><span>Today with caller ID available you can identify your callers. When you are focused on your task at hand and the time you have to accomplish it, you must learn to better control the telephone. </span>
5 0
3 years ago
Does the sticker list an automatic or manual transmission?
pantera1 [17]
Automatic, three speed transmission
5 0
3 years ago
Read 2 more answers
You are most likely to use<br> images for photos or digital paintings.
Lubov Fominskaja [6]

Answer: Digital Paintings

7 0
2 years ago
I have a question, but it's not a math question. Can anyone give me 5 unblockers for school computers? If you answer this, you w
ValentinkaMS [17]

Answer:

I mean if your talking about games then just try Cool math I will give link in comments

Explanation:

4 0
1 year ago
Read 2 more answers
Other questions:
  • What aspect of the internet makes it fault-tolerant?
    6·1 answer
  • What was the first browser that allowed for graphics to be viewed on the web?
    14·2 answers
  • If you think the user might enter 24.9, you should create a float variable. true or false
    9·1 answer
  • Which of the following are documents that can help you to review and assess your organization’s status and state of security? Fi
    6·1 answer
  • Which of the following focuses on information related to disease identification, control, and prevention?
    10·1 answer
  • The individual accountable for ensuring the day-to-day operation of the InfoSec program, accomplishing the objectives identified
    7·1 answer
  • What is the output of the following code:
    12·1 answer
  • HELP I SUCK IN THIS HELP!!!!! ​
    13·1 answer
  • A search expression entered in one search engine will yield the same results when entered in a different search engine.
    15·1 answer
  • What is the shortcut key to create a new desktop ​
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!