StudentArray - import*; public class StudentArray...

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

View Full Document Right Arrow Icon
import*; i public class StudentArray extends StudentsContainer { private StudentNode[] students; p public StudentArray(int size) { /* implement */ students = new StudentNode[size]; } public void makeList(String filename) { /* implement */ try { BufferedReader br = new BufferedReader(new FileReader(filename)); B String line; int i = 0; i while ((line = br.readLine()) != null) { java.util.StringTokenizer st = new java.util.StringTokenizer( line, " \t"); l int ID = Integer.parseInt(st.nextToken()); String name = st.nextToken(); double score = Double.parseDouble(st.nextToken()); d students[i] = new StudentNode(ID, name, score); i++; } br.close(); java.util.Arrays.sort(students); } catch (Exception e) { System.out.println("Exception!"); } } public boolean insertStudent(int ID, String name, double point) { return false; } public boolean deleteStudent(int ID) { return false; } public boolean updateStudent(int ID, String name, double score) { /* implement */ for (int i = 0; i < students.length; i++) {
Background image of page 1

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

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

This note was uploaded on 04/09/2010 for the course CS CS101 taught by Professor Hwang during the Spring '10 term at 카이스트, 한국과학기술원.

Page1 / 2

StudentArray - import*; public class StudentArray...

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

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