// File: Main.java
// Time-stamp: "2005-09-18 22:11:24 calvanese"
// Purpose: Written exam 7/6/2005 - BSc in Computer Science (8CFU)
//          Main program for testing the solution

import java.io.*;

public class Main {

  public static SkiPool readSkiPool(String filename)
                                        throws IOException, SkiPoolException {
    FileReader f = new FileReader(filename);
    BufferedReader br = new BufferedReader(f);

    SkiPool sp = new SkiPool("shop");
    int count = 0;
    Ski b = Ski.readSki(br);
    while (b != null) {
      sp.newSki(b);
      b = Ski.readSki(br);
      count++;
    }

    f.close(); // or equivalently br.close();
    return sp;
  }


  public static void main (String[] args) throws IOException, SkiPoolException {
    
    SkiPool sp = readSkiPool("skis.txt");

    ClientSkiPool.brandsForHeight(sp,  70, "brands-070.txt");
    ClientSkiPool.brandsForHeight(sp,  80, "brands-080.txt");
    ClientSkiPool.brandsForHeight(sp,  90, "brands-090.txt");
    ClientSkiPool.brandsForHeight(sp, 100, "brands-100.txt");
    ClientSkiPool.brandsForHeight(sp, 110, "brands-110.txt");
    ClientSkiPool.brandsForHeight(sp, 115, "brands-115.txt");
    ClientSkiPool.brandsForHeight(sp, 170, "brands-170.txt");
    ClientSkiPool.brandsForHeight(sp, 180, "brands-180.txt");
    ClientSkiPool.brandsForHeight(sp, 210, "brands-210.txt");

  }
}
