Anonymous
Anonymous asked in Computers & InternetProgramming & Design · 1 month ago

# Design a program that asks the users to enter a series of 10 numbers. The program should do the following things in pseudo code.?

The smallest number in array

The largest number in array

The total of the numbers in the array.

The mean of the numbers in the array

Then median of the numbers in the array

Relevance
• 1 month ago

Since it's pseudo code, it becomes a lot easier. You build an array with their inputs, and then sort the array so smallest number is index 0, largest is count() - 1, median is count()/2 - 1. Mean and total have to be manually computed.

Scanner input = new Scanner();

int[] numbers = new int[10];

for (int i = 0; i < 10; i++){

int number = input.nextInt();

numbers[i] = number;

}

Arrays.sort(numbers);

System.out.println(numbers[0]);                                   <- smallest

System.out.println(numbers[numbers.count() - 1]);     <- largest

System.out.println(numbers[numbers.count()/2 - 1]);  <- median

int total = 0;

foreach(int x in numbers){

total = total + x;

}

System.out.println(total / numbers.count()); <- mean

System.out.println(total)                               <- total of all numbers

• EddieJ
Lv 7
1 month ago

If the assignment was just to do

The total of the numbers in the array

could you do that much?

If so, show us.