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
2 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]2 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
How do design elements and color work together on a web page?
KiRa [710]

Answer:

The answer I believe is: 2. Both Enhance visual appeal.

Explanation:

4 0
2 years ago
If an M:N relationship is mandatory on both sides, and if both relations resulting from the entities involved in the relationshi
vivado [14]

Answer:

0

Explanation:

In the problem above, the relationship that exists between M and N is discovered to be on each side of the system. Furthermore, it was stated that the outcome of the relationship also has approximately 3 records. This shows that there is no record for the bridge that is formed as a result of the relationship.

4 0
3 years ago
The basic form of backup used in magnetic tape operations is called
Harrizon [31]
Answer is the son-father-grandfather concept. Good luck
5 0
2 years ago
Poshmark is more than a shopping app; it connects people and brings them together. Poshmark is a passionate group of people that
babymother [125]

Poshmark is more than a shopping app. It is known to be a shopping applicationthat links a person to other people whose style one likes.

<h3>What is the aim of Poshmark?</h3>

Poshmark is known to be a shopping app that links a person to other people whose style one likes adore.

It is known to help one to easily shop for any of their closets and boutiques needs. They are known to have about 80 million community members in all of the U.S., Canada, and Australia.

learn more about Poshmark from

brainly.com/question/26258231

8 0
2 years ago
Gwen's company is planning to accept credit cards over the Internet. Which one of the following governs this type of activity an
podryga [215]

Answer:

Payment Card Industry Data Standard(PCI DSS).

Explanation:

The online payment acceptance through credit cards is governed by the Payment Card Industry Data Standard (PCI DSS) and it also includes the provisions that shoulde be implemented by gwen's company before accepting any transaction through credit cards.

8 0
3 years ago
Other questions:
  • 2. Which of the following best describes the protocols used on the Internet?
    15·1 answer
  • What can be designed to create annoying glitches or destroy data
    11·1 answer
  • _____ creates a border or space that separates information.
    14·1 answer
  • Which HTML tag is used to add a paragraph to a web page?
    15·1 answer
  • . _______ are used to categorize information found on the web
    13·1 answer
  • Grace is performing a penetration test against a client's network and would like to use a tool to assist in automatically execut
    13·2 answers
  • In most programming languages, the compiler carries a preprocessing step to determine if certain statements will compile. For in
    7·1 answer
  • Identify the correct sequence of steps to change the font from Verdana to Arial.
    5·1 answer
  • Because all the IEEE WLAN features are isolated in the PHY and ____________ layers, practically any LAN application will run on
    11·1 answer
  • Figure out what this says:<br><br> ?driew tib a kool ti seoD
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!