classSortjava(works)

classSortjava(works) - Sheet1 Page 1 // Matt Hergenrether...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Sheet1 Page 1 // Matt Hergenrether // Section 10 // // CS 1113 import java.util.* public class ClassSort { private static final boolean DEBUG_SW = true public static void main(String args) { final int SIZE_ARR = 30 final String SENTINEL = "EndDatabase" final String SENTINEL2 = "EndSearchKeys" Student stuArr = new Student[SIZE_ARR] String nameTemp = "" double gpaTemp = 0.0 int idNumTemp = 0 String yearTemp = "" int numStu = 0 Student stu Student key int pos = 0 Scanner scan = new Scanner(System.in) if(scan.hasNext()) nameTemp = scan.next() else { System.out.println("\nInvalid Input: TERMINATE\n") System.exit(0) } if(DEBUG_SW) System.out.println("\nDEBUG\n Name Entered: " + nameTemp) while(!nameTemp.equals(SENTINEL)) { if(scan.hasNextDouble()) { gpaTemp = scan.nextDouble() if(DEBUG_SW) System.out.println("\nDEBUG\n GPA Entered: " + gpaTemp) } else { System.out.println("\nInvalid Input: TERMINATE\n") System.exit(0) } if(scan.hasNextInt()) { Sheet1 Page 2 idNumTemp = scan.nextInt() if(DEBUG_SW)...
View Full Document

This note was uploaded on 09/28/2011 for the course CS 1113 taught by Professor Chandler during the Fall '08 term at Oklahoma State.

Page1 / 5

classSortjava(works) - Sheet1 Page 1 // Matt Hergenrether...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online