/* * File: FindRange.java * Name: Axel Werner * Section Leader: * -------------------- * This file is the starter file for the FindRange problem. */ import acm.program.*; public class FindRange extends ConsoleProgram { /** * Main Program to requests a list of integers from the user * to determine and report the min. + max. numbers in the list. * */ public void run() { println("FindRange\n"+ "==============================\n\n" ); println( "Please enter a list of integer Numbers, one a line,\n" + "or enter '" + SENTINEL + "' to finish the data entry.\n" ); input = readInt("?:"); if(input==SENTINEL){ /* * Special Case 2: * No values has been entered. Aborting Programm with * special note. */ println("No Values has been entered. Aborting Programm."); } else { /* * Special Case 1: * Since this is the FIRST VALUE it is also the smallest * AND the largest entry so far i put it * to the Stats. * Background: * integer vars seem to get a "default value" of "ZERO" when defined. * That makes is problematic when comparing with min and max. */ max=input; min=input; while( input != SENTINEL ){ if(input>max){ max=input; } if (input