Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

actionjcl

The expression (done | | s.compareTo(t) < 0) is true

  • one year ago
  • one year ago

  • This Question is Open
  1. actionjcl
    Best Response
    You've already chosen the best response.
    Medals 0

    assume that boolean done = false, int x = 10, int y = 11, String s = "Help" and String t = "Goodbye"

    • one year ago
  2. actionjcl
    Best Response
    You've already chosen the best response.
    Medals 0

    This is a Java problem

    • one year ago
  3. andrew.m.higgs
    Best Response
    You've already chosen the best response.
    Medals 0

    What does s.compareTo(t) do? I assume it is returning a value less than zero.

    • one year ago
  4. Invincible
    Best Response
    You've already chosen the best response.
    Medals 0

    it compares string S with t letter by letter. and returns true if both are equal

    • one year ago
  5. andrew.m.higgs
    Best Response
    You've already chosen the best response.
    Medals 0

    Can someone paste the code or problem here please?

    • one year ago
  6. msmithhnova
    Best Response
    You've already chosen the best response.
    Medals 0

    This seems like a very strange thing to do and I don't know if there is a question here or what is is but evaluating the first expression since done is false and s is not the same as t we get. false || false < 0 since || is a logical OR operator we have false or false < 0 so how does one evaluate false < 0 ? well in some languages, false is just a fancy 0 and true is just a fancy 1 so it could potentially evaluate to false. In some languages it would say boolean start with 'b' and integer starts with 'i' and therefore it could evaluate to true since 'b' is less than 'i' and give us our two options false or false which is false false or true which is true I don't know if this helps or if it answers the question but there it is.

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.