// File: ClientBikePool.java
// Time-stamp: "2005-08-18 12:59:14 calvanese"
// Purpose: Written exam 28/6/2005 - BSC in Production Engineering
//          solution part 3

import java.io.*;

public class ClientBikePool {

  public static void colorsForWeight(BikePool bp, int weight, String filename)
                                                           throws IOException {
    FileWriter f = new FileWriter(filename);
    PrintWriter out = new PrintWriter(f);
    String[] codearray = bp.bikesForWeight(weight);
    for (int i = 0; i < codearray.length; i++)
      out.println(bp.getBike(codearray[i]).getColor());
    f.close();  //or out.close();
  }

}
