answersLogoWhite

0


Best Answer

import java.util.Arrays;

import java.util.Scanner;

public class Answers {

public static void main(String[] args) {

//Creates a scanner object named console.

Scanner console = new Scanner(System.in);

//Variabels

int [] numbers = new int [10];

double avg = 0.0;

double median = 0.0;

int max = numbers[0];

double count = 0.0;

//User input.

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

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

numbers[i] = console.nextInt();

}

//break

System.out.println("===============");

//finds the average and max value.

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

count += numbers[i];

avg = count / numbers.length; //average

if (numbers[i] > max){ //finds the max value.

max = numbers[i];

}

}

median = (numbers[4] + numbers[5])/2; //Median value

//Display to user.

System.out.println("Highest value found: " + max); //Show maximum value found in array

System.out.printf("Median is: %.3f \n",median); //Show median

System.out.printf("Average is: %.3f \n",avg); //Show average

sortAsc(numbers); //Print out whole array ascending

}

//Method for sorting an Array ascending.

public static void sortAsc(int [] array){

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

Arrays.sort(array);

System.out.println(array[i]);

}

}

}

This should do everything you asked for, hope this helps!

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you create Write a program that takes 10 integers as input The program will place these integers into an array and display the following 1. List in ascending order 2. mean 3. median 4.max val?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

How do you write a program to read set of numbers using by an array and display the ascending order of the given input numbers?

To write a C++ program to display the student details using class and array of object.


Write a program in c that prompt user with following lines add two integers test an integer for odd or even and quit?

write a program in C that prompts the user with the following lines: a) Add two integers c) Compare two integers for the larger t) Test an integers for odd or even q) Quit


How can you write a c program to display numbers in ascending order in array?

I know how to do this and you need to know how to do this. Why don't you do your best at writing this program and if it does not work then ask for help. You will not learn anything if I give you the answer.


Write a program for which give number in ascending number?

the following program will display all numbers given in the array in ascending order #include&lt;stdio.h&gt; void main() { int i,h,p; int numbers[10]={5,8,3,2,6,7,9,4,1,10}; for(p=0;p&lt;=8;p=p+1) { for(i=0;i&lt;=8;i=i+1) { if(numbers[i]&gt;numbers[i+1]) { a=numbers[i]; numbers[i]=numbers[i+1]; numbers[i+1]=a; } } } for(i=0;i&lt;=9;i=i+1) { printf("%d ",numbers[i]); } }


Write an Assembly language program which implements sorting algorithm both ascending and descending order and display those numbers with certain delay say of 5sec between successive displays?

das


Write a program which takes the gender and salary the age from user the program should calculate and display the following information you If gender is male and age is greater equals 18 then the tax?

Write a program which takes the gender and salary ,the age from user. the program should calculate and display the following information. i. If gender is male and age is greater &gt;=18,then the tax =5%of the salary. ii. If gender is female and age is &gt;=18,then tax=3%of salary. The program should display the output as follows: Gender = Age = Tax = Salary before tax = Salary after tax =


How do you start the display program in Linux from the command line?

the command "display" brings up the ImageMagick program.


A C program using dynamic memory allocation to sort n names in ascending order?

Writing a C program that uses dynamic memory allocation to sort names in ascending order is a typical computer science assignment. To write this program, you must be in UNIX.


What will be the program to arrange numbers stored in array in ascending order using pointers?

sorry


Writes a c program to find the sum of all integers between 1 and n?

Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11


How do you get a Java program to display a backslash in output without it interpreting it as a program command?

Follow the backslash with another backslash: System.out.println("\\ " \"); will display \ " \ on the screen.


How can one assign a list of integers in Java?

Put statements at the start of ones code will allow one to have a list of integers in their Java program. If one does this then they will successfully have integers in their code.