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
When should you create an outline?
liraira [26]

Answer:custom slide show

Explanation:

5 0
3 years ago
Arman, a friend of your dad, has a computer running Windows 7 and wants to perform an upgrade. He has only 3GB of RAM in his com
torisob [31]

Answer:

Low memory?

So to fix the problem you could add more memory to the machine.

Explanation:

8 0
3 years ago
Joe, a user, wants his desktop RAID configured to allow the fastest speed and the most storage capacity. His desktop has three h
kirill115 [55]

Answer:

A. 0

Explanation:

The technician should configure the RAID 0 for Joe.

RAID 0 also referred to as the striped volume or stripe set is configured to allow the fastest speed and the most storage capacity by splitting data evenly across multiple (at least two) disks, without redundancy and parity information.

Also, RAID 0 isn't fault tolerant, as failure of one drive will cause the entire array to fail thereby causing total data loss.

7 0
3 years ago
To save a file in word, you can select File, Save (save as), select the location, type the file name, and select save. What is t
Inessa [10]

Answer:

The answer to this question is given below in the explanation section

Explanation:

To save a file in word, you can select File, Save (save as), select the location, type the file name, and select save.

If you want to save the file in word using shortcut. Then, for saving the file, you need to press Ctrl+S. If you want to save the file as (Save as), then you need to press F12.

3 0
3 years ago
: For each of the following words identify the bytethat is stored at lower memory address and the byte that is storedat higher m
Aloiza [94]

Answer:

In a <u>little endian computer</u> -The data's least substantial byte is put at the lower address byte. The remaining information will be put in memory in order in the next three bytes.

a)1234

4 is placed at the least significant bits,so this byte stored at lower memory address.

1 is placed at the most significant bits,so this byte stored at higher memory address.

b) ABFC

C is placed at the least significant bits,so this byte stored at lower memory address.

A is placed at the most significant bits,so this byte stored at higher memory address.

c) B100

0 is placed at the least significant bits,so this byte stored at lower memory address.

B is placed at the most significant bits,so this byte stored at higher memory address.

d) B800

0 is placed at the least significant bits,so this byte stored at lower memory address.

B is placed at the most significant bits,so this byte stored at higher memory address.

5 0
3 years ago
Other questions:
  • A(n) ____________________ stores copies of data or programs that are located on the hard drive and that might be needed soon in
    9·1 answer
  • A c++ member function that uses, but does not change, the value of a member variable is called
    13·1 answer
  • The purpose of a lockout tagout checklist is to​
    9·2 answers
  • Design an algorithm for finding all the factors of a positive integer. For example, in the case of the integer 12, your algorith
    8·1 answer
  • Write an SQL statement to list the Name of employees who have worked on a property in New York .
    7·1 answer
  • What is the output of adding 1001011 and 100000?
    7·1 answer
  • Cryptography has requirements include:
    8·1 answer
  • Common names for computer-based information systems are transaction processing, management information, ________, and executive
    5·1 answer
  • Which of the following offers more reliable antivirus protection? Question 43 options: A) antivirus software on user PCs B) anti
    10·1 answer
  • What are the sectors of the buisness enviornment
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!