Created
June 10, 2013 14:54
-
-
Save miclovich/5749356 to your computer and use it in GitHub Desktop.
sorting and making your life a whole lot easier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: FindRange.java | |
* Name: | |
* Section Leader: | |
* -------------------- | |
* This file is the starter file for the FindRange problem. | |
*/ | |
import java.util.ArrayList; | |
import acm.program.*; | |
import acmx.export.java.util.Collections; | |
import acmx.export.java.util.List; | |
public class FindRange extends ConsoleProgram { | |
private ArrayList<Integer> array = new ArrayList<Integer>(); | |
public void run() { | |
for (int i = 0; i < 7; i++) { | |
array.add(readInt("Put in a value: ")); | |
} | |
// Collections.sort((List) array); | |
println("smallest: "+Collections.min((List) array)); | |
println("Largest: "+ Collections.max((List) array)); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment