import javax.swing.JOptionPane;

public class Main {
  private static void leggiCanali(Televisione t) {
    for (int i = 0; i < t.quantiCanali(); i++) {
      String s = JOptionPane.showInputDialog("Stazione " + i);
      t.associa(s,i);
    }
  }
  public static void main(String[] args) {
    int c1 = Integer.parseInt(
      JOptionPane.showInputDialog("numero canali televisione 1"));
    int c2 = Integer.parseInt(
      JOptionPane.showInputDialog("numero canali televisione 2"));
    int c3 = Integer.parseInt(
      JOptionPane.showInputDialog("numero canali televisione 3"));
    int c4 = Integer.parseInt(
      JOptionPane.showInputDialog("numero canali televisione 4"));
    Televisione t1 = new Televisione(c1);
    Televisione t2 = new Televisione(c2);
    Televisione t3 = new Televisione(c3);
    Televisione t4 = new Televisione(c4);
    leggiCanali(t1);
    leggiCanali(t2);
    leggiCanali(t3);
    leggiCanali(t4);
    Televisione[] at = {t1, t2, t3, t4};
    String s = JOptionPane.showInputDialog("Stazione?");
    System.out.println("La stazione " + s +
                       " e' presente in " + 
                       StazioniSintonizzate.quanteStazioni(at,s)
                       + " stazioni!");
  }
}
