/**
 * A program to demonstrate the use of GermanVerb and 
 * GermanRegVerb objects.
 * 
 * WS10/11 hw9: Inheritance
 */
import java.util.*;
public class GermanRegVerbDemo
{
    public static void main(String[] args)
    {
        Scanner keyboard = new Scanner(System.in);
        String verb;
        GermanVerb gv = null;
        
        // keep going till the user enters "q"
        while (true)
        {
            System.out.print("Enter a german verb (q to stop): ");
            verb = keyboard.next();
            
            if (verb.equalsIgnoreCase("q"))
            {
                System.exit(0);
            }
            
            if (GermanVerb.isVerb(verb))
            {
                // ok because a GermanRegVerb "is-a" GermanVerb
                gv = new GermanRegVerb(verb);
                System.out.println(gv + "\n");
                System.out.println(gv.conjugatePres());
            }
            else
            {
                System.out.println(verb + " is not a german verb");
            }
            System.out.println();
        }
    }
}
