import java.io.*;

public class BuchEingabeTastatur {
        
  private static BufferedReader in =
     new BufferedReader (
       new InputStreamReader(System.in));
        
  public static Buch readBuch() {
                
     Buch b;
                
     do {
       String titel = "", isbn = "";
       System.out.print("Der Buchtitel: ");
       titel = in.readLine();
       System.out.print("Die ISBN:      ");
       isbn = in.readLine();
                                
       try {
         b = new Buch(titel, isbn);
         return b;                               
       } catch (FalscheIsbnException e) {
         System.out.println("Ungueltige ISBN. "+
                            "Neue Eingabe.");
       }
     } while (true);
   }
        
   public static void main(String[] args) {
     System.out.println("Mein Buch: " + readBuch());
   }       
}
