public void run() {
		println ("This program find the largest and smallest numbers.");
		int n = readInt ("? ");
		if ( n == SENTINEL) {
			println ("The program is terminated by your input of the setinel number. ");
		}
		/* variable amountInput is for counting the amount of numbers we've input.
		 * variable largestNum and smallestNum is for the recording of the largest and the smallest number respectively.*/
		int amountInput = 0;
		int largestNum = n;
		int smallestNum = n;
		while (n != SENTINEL) {
			n = readInt ("? ");
			amountInput ++;
			if (n > largestNum){
				largestNum = n;
			}
			if (n < smallestNum){
				smallestNum = n;
			}
		}
		/* reports the result of the largest and the smallest numbers. */
		if (amountInput != 0){
			if (amountInput != 1){
				println ("smallest: " + smallestNum);
		        println ("largest: " + largestNum);
		        /* the following part deals with the situation when only one value is input before 
		         * the user input the sentinel value. That value is reported as both the largest and
		         * the smallest value. */
			}else {
				if ( largestNum-n == 0 ){
					println ("smallest: " + smallestNum);
			        println ("largest: " + smallestNum);
				}else {
					println ("smallest: " + largestNum);
			        println ("largest: " + largestNum);
				}
			}	        
	}
  }