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
Which are examples of traditional computer-based technology?
marta [7]

Answer:

Explanation:

Spreadsheet software is the correct answer

8 0
3 years ago
Read 2 more answers
The ________ is the most important component in a computer because without it, the computer could not run software. Note: You ma
densk [106]

Answer:

Central processing unit (CPU)

Explanation:

A computer can be defined as an electronic device that is capable of receiving of data in its raw form as input and processes these data into information that could be used by an end user.

The central processing unit (CPU) is typically considered to be the brain of a computer system. It is the system unit where all of the processing and logical control of a computer system takes place.

Hence, the most important component in a computer is the central processing unit (CPU) because without it, it is practically impossible for the computer to run any software application or program.

Additionally, the component of the central processing unit (CPU) that controls the overall operation of a computer is the control unit. It comprises of circuitry that makes use of electrical signals to direct the operations of all parts of the computer system. Also, it instructs the input and output device (I/O devices) and the arithmetic logic unit on how to respond to informations sent to the processor.

8 0
3 years ago
Which team member on a project typically understands color theory and graphic art? A Art director B Editor CProgrammer D Softwar
Serggg [28]

Answer:

(A) Art Director

Explanation:

The art director will be responsible for all of the visual graphics in a project so they would require knowledge in colour theory and graphic art.

8 0
3 years ago
The period of history before the invention of writing is called
Dmitry_Shevchenko [17]

The period of history before the invention of writing is called unrecorded history.

3 0
3 years ago
It is not important to keep financial records since they can all be found online.
aleksandr82 [10.1K]

Answer:

False

Explanation:

Due to the fact that financial records can be erased. Also, I believe it is a law to keep financial records when doing business but I'm not too sure.

6 0
4 years ago
Read 2 more answers
Other questions:
  • Carmina wants to move a paragraph to the right margin of the document she is working in. She moves her cursor to
    8·2 answers
  • Universal Containers (UC) is currently live with Sales Cloud and in the process of implementing Service Cloud. UC wants to creat
    5·1 answer
  • The key invention that enabled computers to go into every home and office is
    8·1 answer
  • Database applications are seldom intended for use by a single user.
    15·1 answer
  • When you need to switch on an electrical current at a remote location, would you use a relay or an amplifier?
    10·1 answer
  • Which are guidlines for using themes? Check all that apply
    13·1 answer
  • Why is Data-Driven Analytics of interest to companies?
    12·1 answer
  • Write a program that defines an array of integers and a pointer to an integer. Make the pointer point to the beginning of the ar
    12·1 answer
  • Adding Objects in Outlook
    10·1 answer
  • Anyone tell my answer.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!