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
Wittaler [7]
3 years ago
7

Write a method called mode that returns the most frequently occurring element of an * array of integers. Assume that the array h

as at least one element and that every element * in the array has a value between 0 and 100 inclusive. Break ties by choosing the lower * value. */
Computers and Technology
1 answer:
labwork [276]3 years ago
8 0

Answer:

The method definition to this question can be given as:

Method definition:

public static int mode(int[] a1) //define method mode.

{

int[] a = new int[101]; //define array.

int i,mode =101,counts = 0; ; //define variable.

for (i = 0; i <a1.length; i++) //loop  

{

a[a1[i]]++; //increasing value.

}

for (i = 0; i <a.length; i++)//loop  

{

if (a[i]>counts)//if block

{

counts=a[i]; //variable holds array value.

mode = i; //variable holds i value.

}

}

return mode;

}

Explanation:

The description of the above method as follows:  

  • Firstly we define a method that is "mode" in this method we pass an integer array that is "a1[]" and the method returns an integer value because its return type is "integer".  
  • Inside a method, we define another array and variables that are "a[], mode, i, and counts". array variables collect the parameter passed the array and check the lowest value element in the array. To check this condition we use these variables and conditional statements.  
  • Then we define a loop inside the loop use conditional statement in the if block we check array element value is grater than counts if this condition is true so, counts variable value is changed by array value and mode variable holds loop variable (i)value and return mode value.
You might be interested in
Im confused sorry.. can i get help?
garik1379 [7]

1.

If-then statements are used in a program to run certain code when ideal conditions are met.

2.

Since the variable word holds the word kangaroo and the if statement is asking if the variable word is equal to KANGAROO, the else statement will run. The output will be FALSE

3.

if (90 < = x <= 100) should be rewritten as Nothing, the if statement is correct.

4.

You use an else statement when you want your code to do something if your if statement is false.

5.

if (num1 != num2)

I hope this helps!

7 0
3 years ago
if you dont' have access to nessus, which of the following can be used by an attacker to gain information about remote *nix host
galina1969 [7]

The NMap procedure that can be used to help you to gain information about remote *nix hosts is Script Scanning

<h3>What is script scanning?</h3>

The script scanner is known to be tool that acts as a measure component to the real Windows scripting host component as it helps to intercepts scripts, and also scans them before they are said to be executed.

Therefore, The script scanner is known to be tool that acts as a measure component to the real Windows scripting host component as it helps to intercepts scripts, and also scans them before they are said to be executed.

Learn more about Script Scanning from

brainly.com/question/18152781

#SPJ11

4 0
2 years ago
After an entry in the medical record has been written or keyed and an error is discovered, what procedure should be followed to
Readme [11.4K]

Answer:

(C) Draw a line through the error; then call the patient’s physician.

Explanation:

According to my research on medical procedures, I can say that based on the information provided within the question the best procedure that should be taken in this situation would be to draw a line through the error; then call the patient’s physician. By doing so you get rid of the the error and by telling the patient's physician you get rid of any possibility of the physician still thinking that the error was something that was already done.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

5 0
3 years ago
what sequence of tabs and buttons should hema select to include the current date on the pages printed with the speaker notes
SVEN [57.7K]
What sequence of tabs and buttons should Hema select to include the current date on the pages printed with the speaker notes?

Insert tab → Header & Footer → Notes and Handouts → Date and time → Update automatically
View → Header & Footer → Notes and Handouts → Date and time → Fixed
Insert → Notes and Handouts → Header & Footer → Date and time → Update automatically
View → Notes and Handouts → Header & Footer → Date and time → Fixed

Hope this helps.
8 0
3 years ago
Read 2 more answers
Please answer quick! Screenshot included
grigory [225]
The answer is B because of the css is a non smoking area and that cause of smoking kills
5 0
3 years ago
Other questions:
  • One governing factor when determining the minimum size of conduit to be used is the 
    9·2 answers
  • How to cite a dictionary in mla 8 owl perdue?
    13·1 answer
  • PLEASE FILL IN THE BLANK FOR THESE POINTS!!!!!
    15·2 answers
  • With respect to the five components of social media information systems (SMIS), which of the following statements is true of SM
    11·1 answer
  • Which model represents scenarios thatchange over time?
    8·1 answer
  • Dusk is considered “a magic hour” by photographers and is the time when light is the least harsh. True or false.
    12·2 answers
  • Instructions:Select the correct answer.
    15·1 answer
  • Is anyone a robIox moderator?
    13·2 answers
  • What is the role of UPS in Computer security?<br>4 marks answer​
    12·1 answer
  • Apart from using secure networks, how else can Dhruv keep his deliverables safe in the office and on the go? Select all that app
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!