public static void main(String[] args) {
        System.out.println(" Enter a terminating value ");
        double term = IO.readDouble();
        System.out.println(" How many numbers will you enter ");
        double numbers = IO.readDouble(); //reading the value of how many numbers the user will enter
        System.out.println(" What is the largest number you will enter ?");

            System.out.println(" There must be at least 1 number ");

        double biggest = IO.readDouble(); //reading the first value and setting it to a variable
        System.out.println(" What is the smallest number you will enter ");
        double smallest = IO.readDouble();

        for(double i = 0; i < numbers; i++){   //loop will execute until the user has put in all the numbers
            System.out.println(" Enter the numbers ");
            double x = IO.readDouble();
            if(x > biggest){
                biggest = x;    //only executes if the current read value is bigger than the variable.
                if(x < smallest){
                    smallest = x;




This is the code I've done till now, and this is the question:

Ask the user for a terminating value which should be entered again when they are done inputting the list of numbers.
First output the smallest number and then the biggest number.
There must be at least 1 number in the list.

The problem i'm having is that what do I add in my code so that it stops the program when the user enters the terminating value again, and outputs the largest and smallest number. Any help would be helpful, Thanks!

I may be guessing here but it sounds like you need a loop that starts at about line 3 to 4 and the end loop/test is about line 32.