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
Maslowich
3 years ago
12

Implement the ArrayMethod application containing an array that stores eight integers. The application should call the following

five methods: 1. display - should display all the integers 2. displayReverse - should display all the integers in reverse order 3. displaySum - should display the sum of the integers 4. displayLessThan - should display all values less than a limiting argument 5. displayHigherThanAverage - should display all values that are higher than the calculated average value.
Computers and Technology
1 answer:
AveGali [126]3 years ago
8 0

Answer:

public static void display(int [] arr){

   System.out.print("Arrays: ");

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

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

       }

       System.out.println();

   }

   

public static void displayReverse (int [] arr){

   System.out.print("Arrays in reverse order: ");

       for(int i=arr.length-1;i>=0;i--){

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

       }

       System.out.println();

   }

   

public static int displaySum (int [] arr){

   System.out.print("Sum: ");

   int sum = 0;

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

           sum+=arr[i];

       }

       return sum;

   }

   

public static void displayLessThan (int [] arr, int num){

       System.out.print("Less than "+num+": ");

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

           if(arr[i]<num){

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

           }

       }

       System.out.println();

   }

public static void displayHigherThanAverage  (int [] arr){

       System.out.print("Higher than average: ");

       int sum = 0;

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

           sum+=arr[i];

       }

       float average = sum/arr.length;

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

           if(arr[i]>average){

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

           }

       }

       System.out.println();

   }

Explanation:

<em>The methods were written in Java. See attachment for explanation where I used comments to explain each lines.</em>

<em>Note that lines that begin with double slash (//) are comments</em>

Download txt
You might be interested in
Jenny needs to record the names of 30 students, write down the subjects they studied, and note their grades in each subject afte
lidiya [134]

Answer:

<em>The </em><em>answer </em><em>is </em><em>(</em><em>A)</em>

Explanation:

Double-click both the worksheet tabs one at a time and then enter the new names.

6 0
2 years ago
A large computer repair company with several branches around Texas, TexTech Inc. (TTi), is looking to expand their business into
Aleks04 [339]

Answer:

hecks

Explanation:

nah

6 0
3 years ago
Select the correct answer.
8090 [49]

Answer:

Definitally c

Explanation:

6 0
3 years ago
Which of the following are computer safety techniques? Check all of the boxes that apply.Identify Computer Safety Techniques:
zvonat [6]

Answer: Protect the system with a password  

               Use spam protection.

               Avoid using questionable software.

               

Explanation:

4 0
3 years ago
A loop decision point for an algorithm consists of three features: an initial value, a set of actions to be performed, and a(n)
pychu [463]

Answer:

Option c is the correct answer for the above question.

Explanation:

A loop is used to repeat some lines in some specific times which depends on some conditions of the loop. If a person wants to print "welcome" on 5 times then he can do this by two ways one is writing a print statement 5 times and the other is states a loop that executes 5 times through condition. The loop is described or written by three necessary points which are:-

  1. The fist is to initialize the initial value which tells the compiler for the starting point of the loop.
  2. The second is to any action for that condition variable which takes the loop for the direction of ending points.
  3. The third is a condition that defines the ending point of the loop.

The above question also states about the loop in which first and second points are given then the third point is necessary to complete the sentence which is states in option c. Hence the option c is correct while the other is not because--

  • Option 'a' states about the class operator which is not the part of the loop.
  • Option b states about the documentation plan which is also not the part of the loop.

5 0
3 years ago
Other questions:
  • What is the software called that allows the user to create, access, and manage a database? question 8 options:
    10·1 answer
  • You can encrypt individual files, but microsoft recommends encrypting at what level?
    9·1 answer
  • What does computer means?
    13·2 answers
  • Which of the operating systems listed below is not proprietary?
    8·1 answer
  • Quick SearchLinks to an external site. lets you refine or narrow your search results using links on the right side of the screen
    5·1 answer
  • What is the use of technology to enable people to learn anytime and anywhere​
    13·1 answer
  • Modify the program you wrote for Chapter 6 Exercise 6 so it handles the following
    15·1 answer
  • Transitive spread refers to the effect of the original things transmitted to the associate things through the material, energy o
    6·1 answer
  • Discuss the advantages and disadvantages of supporting links to files that cross mount points (that is, the file link refers to
    6·1 answer
  • FOR A BRAINLIEST
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!