Пример #1
0
  private void setupPupilList() throws IOException { // placeholder
    System.out.println("School : PupilMark update");
    System.out.println("** Preparing to read data file.");
    String[] dataRows = PupilMark.readCSVtable();
    noOfPupils = dataRows.length;
    System.out.println("** " + noOfPupils + "rows read .\n\n");
    pupilList = new PUPIL[noOfPupils];

    for (int i = 0; i < noOfPupils; i++) {
      pupilList[i] = new PUPIL();
      pupilList[i].readPupilDetails(dataRows[i]);
    }
  }
Пример #2
0
  private void setupTicketList() throws IOException {
    // first message
    System.out.println("** Preparing to read ticket details**");
    // read file, get data as string array separated by commas
    String[] dataRows = ticketData.readCSVtable();

    // calculate number of tickets in order to be stored in array, subtract 1
    noOfTickets = dataRows.length;

    // print the number of ticket details read
    System.out.println("** " + noOfTickets + " rows read");

    ticketList = new TICKET[noOfTickets];

    for (int i = 0; i < noOfTickets; i++) {
      ticketList[i] = new TICKET();

      ticketList[i].readTicketInfo(dataRows[i]);
    }
  }