Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9013699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:20:04+00:00 2026-06-16T03:20:04+00:00

myf = new Finch(); do { //menu 4 if (s.equals(Tap Test)) RunTapTest(s); } private

  • 0
  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 < 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);
        }


    }

Here’s the homework question:

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.

I’m just trying to fix the user specified time interval (at the moment), and I’m having trouble implementing it.

If I attempt this code

if (myf.isTapped() = true) {
            myf.setWheelVelocities(-255,0,tapBack);
        }

I get an error on:

if (myf.isTapped() = true)

Saying

The left-hand side of an assignment must be a variable

I’m struggling on how to get the robot to move backwards if the myf.isTapped = true

Maybe myf.isTapped cannot take boolean values?

I’m using http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Scanner.html for user input (integer in this case)

Also, I think the my.isTapped is from an external Jar file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:20:05+00:00Added an answer on June 16, 2026 at 3:20 am

    Change it to

    if (myf.isTapped() == true)
    

    or even better

    if (myf.isTapped())
    

    = means assignment, == means comparison.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

String s = ; myf = new Finch(); do { //Run the menu until
In C, what is the difference between these two? float myF = 5.6; printf(
In my main application Form I have a number of menu and toolbar button
Given a list, I'm trying to return a new one that has only the
I have developed a little game using XNA 4.0 and C# (new Project->Windows Game
So, I'm experiencing a very weird issue with my little test application. And by
Consider following function definition in ghci. let myF = sin . cos . sum
Basically, at my University, we've been given a Finch Robot to work with and
I'm trying to use a static library created by me in Visual C++ 2005
I have the following code in Scala-IDE: type myF = () => Boolean def

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.