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
n200080 [17]
3 years ago
10

Java: Programming Question: Reverse OrderWrite a program that reads ten integers into an array; define another array to save tho

se ten numbers in the reverse order. Display the original array and new array. Then define two separate methods to compute the maximum number and minimum number of the array.Sample Run:Please enter 10 numbers: 1 3 5 8 2 -7 6 100 34 20The new array is: 20 34 100 6 -7 2 8 5 3 1The maximum is: 100The minimum is: -7Bonus: Determine how many numbers are above or equal to the average and how many numbers are below the average.
Computers and Technology
1 answer:
Ghella [55]3 years ago
6 0

import java.util.Scanner;

import java.util.Arrays;

public class JavaApplication47 {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.print("Please enter 10 numbers: ");

       String [] nums = scan.nextLine().split(" ");

       int newNums[] = new int [nums.length];

       int w = 0, total = 0, above = 0, below = 0;

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

           newNums[w] = Integer.parseInt(nums[i]);

           w++;

       }

       System.out.println("The old array is: "+Arrays.toString(nums));

       System.out.println("The new array is: "+Arrays.toString(newNums));

       Arrays.sort(newNums);

       System.out.println("The maximum is: "+newNums[9] + "\nThe minimum is: "+newNums[0]);

       for (int i : newNums ){

           total += i;

       }

       total = total / 10;

       for (int i : newNums){

           if (i >= total){

               above += 1;

           }

           else{

               below += 1;

           }

       }

       System.out.println("There are "+above+" numbers above or equal to the average.");

       System.out.println("There are "+below+" numbers below the average.");

   }

   

}

I hope this helps!

You might be interested in
Which is the correct attribute syntax
taurus [48]

ANSWER:  GIVE ME BRAINLIEST AND ILL GIVE YOU THE ANSWER

EXPLANATION: ALL YOU NEED TO DO IS GIVE ME BRAINLIEST FOR THE ANSWER

3 0
3 years ago
Website hosting servers have their own unique IP address, what does this address consist of?
Alchen [17]
A. Numbers and letters
4 0
3 years ago
In which utility is the file search option found in windows
OLEGan [10]

Press Windows logo key + X Key.

Click on Control Panel.

Double Click on Troubleshooting.

Click on View all option, on left hand side of the window.

Click on Search and indexing and follow the on screen instructions.

5 0
4 years ago
Can you please explain this code
Mrac [35]
I don't understand this question
7 0
3 years ago
Select the pseudo-code that corresponds to the following assembly code. Assume that the variables a, b, c, and d are initialized
Nadusha1986 [10]

Answer:

ae

Explanation:

4 0
3 years ago
Other questions:
  • Which of the following filenames is acceptable on both Windows and Mac<br> operating systems?
    9·1 answer
  • What computer would be good for editing and streaming for less than 600$?
    7·1 answer
  • What is TCP/IP's Transport layer's primary duty?
    8·1 answer
  • Plz answer me will mark as brainliest ​
    7·2 answers
  • Which internet site end in .com​
    10·2 answers
  • What is one characteristic of a logic problem? A). a problem that can have three solutions B). a problem that can be solved in a
    5·1 answer
  • Vanessa and Marie are best friends. Vanessa tells Marie that one of their classmates has been posting nasty comments about Vanes
    10·2 answers
  • Read this excerpt from The Outsiders. Or I could have gotten one of the gang to come along, one of the four boys Darry and Soda
    10·2 answers
  • Which search engine do you prefer? Why
    15·2 answers
  • What risks were involved?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!