public class FirstMethodsTask
{
    /* Imagine you are working on a programming team.
       Someone else was responsible for the main method
       and the constructor. You need to fill in the
       remaining methods.
    */


    public void starLine (int amt)
    {
	//1. print a blank line
	//2. print "amt" stars in a horizontal line using a loop
	//3. print a blank line
    }


    public boolean correct (String ans)
    {
	//1. if ans is AGE, age or Age, return true
	//2. else if ans is YEARS, years or Years, return true
	//3. else if ans is YOUR AGE, Your age or your age, return true
	//4. otherwise return false
	return true;
    }


    public boolean isValid (char ans2)
    {
	//1. if they enter a or A return true
	//2. else if they enter b or B return true
	//3. else if they enter c or C return true
	//4. else if they enter d or D return true
	//5. else if they enter e or E return true
	//6. otherwise return false
	return true;
    }


    public String successLevel (int tries)
    {
	//1. Make a positive message for tries ==1
	//2. Make a less positive message for tries ==2
	//3. Make an even less positive message for tries ==3
	//4. Make a still less positive message for tries ==4
	//5. Otherwise, wish them, better luck next time
	return "Good Job!";
    }


    public String randomTryAgain ()
    {
	int n = (int) (Math.random () * 5) + 1;
	//use n in an if to return 5 different try again messages
	return "That is incorrect. Try again.";
    }


    public String randomGreeting ()
    {
	int n = (int) (Math.random () * 8) + 1;
	//use n in an if to return 8 random greetings
	return "Welcome!";
    }


    public static void main (String args[])
    {
	new FirstMethodsTask ();
    }


    public FirstMethodsTask ()
    {
	//Leave this alone
	starLine (40);
	System.out.println (randomGreeting ());
	String ans = IO.inputString ("What goes up but never comes down? ");
	int tries = 1;
	while (!correct (ans))
	{
	    System.out.println (randomTryAgain ());
	    ans = IO.inputString ("What goes up but never comes down? ");
	    tries++;
	}
	System.out.println ("\nThat is correct! It took you " + tries + " tries.");
	System.out.println (successLevel (tries));

	starLine (40);
	System.out.println (randomGreeting ());
	char ans2 = IO.inputChar ("Enter one of a/b/c/d/e: ");
	tries = 1;
	while (!isValid (ans2))
	{
	    System.out.println (randomTryAgain ());
	    ans2 = IO.inputChar ("Enter one of a/b/c/d/e: ");
	    tries++;
	}
	System.out.println ("\nThat is correct! It took you " + tries + " tries.");
	System.out.println (successLevel (tries));


    }
}
