Java user input?
<pre><code>  myf = new Finch();
    do
    {
              //menu 4
    if (s.equals("Tap Test")) RunTapTest(s);

            } 

  private static void RunTapTest(String s)
    {
        @SuppressWarnings("resource")
        Scanner reader = new Scanner(System.in);
        System.out.println("Enter the time interval in which you want the Finch to move backwards: ");

        //get user input for tapBack
        int tapBack = reader.nextInt();

        System.out.println("\n"+"Running: "+s+"\n");
        long before = System.currentTimeMillis();
        while(System.currentTimeMillis() - before &lt; testtime)
        {
            System.out.println(myf.isTapped());
            //myf.setWheelVelocities(-255,0,testtime);

        }
                    //I can't set myf.isTapped = true
        if (myf.isTapped()) {
            myf.setWheelVelocities(-255,0,tapBack);
        }


    }
</code></pre>

<p>Here's the homework question:</p>

<blockquote>
  <p>Menu option 4 will determine if the Finch has been tapped on its tail. 
       If so, the Finch should respond with the spoken words “Thanks” and move backwards 
       for a user specified time interval.</p>
</blockquote>

<p>I'm just trying to fix the user specified time interval (at the moment), and I'm having trouble implementing it. </p>

<p>If I attempt this code </p>

<pre><code>if (myf.isTapped() = true) {
            myf.setWheelVelocities(-255,0,tapBack);
        }
</code></pre>

<p>I get an error on:</p>

<pre><code>if (myf.isTapped() = true)
</code></pre>

<p>Saying </p>

<blockquote>
  <p>The left-hand side of an assignment must be a variable</p>
</blockquote>

<p>I'm struggling on how to get the robot to move backwards if the myf.isTapped = true </p>

<p>Maybe myf.isTapped cannot take boolean values? </p>

<p>I'm using <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Scanner.html" rel="nofollow">http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Scanner.html</a> for user input (integer in this case)</p>

<p>Also, I think the my.isTapped is from an external Jar file. </p>
