Results 1 to 3 of 3
  1. #1
    Army is offline Senior Member
    Join Date
    Jan 2012
    Posts
    147
    Rep Power
    0

    Default Two Java Equations

    Someone please help me with this ASAP,, I don't understand this at all

    1. Solve the expression and find the output of Z = ((X > Y) && (Y < X))? X:Y when int X=5 and Y=10.
    5
    10
    15
    20

    2. Solve the expression and find the output of Z = ((X > Y) || (Y < X))? X:Y when int X=15 and Y=10.
    5
    10
    15
    25

  2. #2
    Army is offline Senior Member
    Join Date
    Jan 2012
    Posts
    147
    Rep Power
    0

    Default Re: Two Java Equations

    Another question I don't understand

    If J=true and K=false, what is J&&K?
    True
    no
    False
    yes

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,519
    Blog Entries
    7
    Rep Power
    20

    Default Re: Two Java Equations

    If X > Y then Y < X so X > Y && Y < X are identical. (both expressions are equivalent). If X > Y or Y < X is a tautology (both expressions are equivalent again).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. equations in java
    By kekcklemen in forum Advanced Java
    Replies: 2
    Last Post: 04-08-2011, 09:17 PM
  2. Output Equations in Java
    By jlbird in forum New To Java
    Replies: 5
    Last Post: 11-02-2010, 03:24 PM
  3. Finding the intercept using two equations.
    By MapleLeafRag in forum New To Java
    Replies: 1
    Last Post: 12-03-2009, 08:32 PM
  4. Solving this equations problem in Java
    By matt_well in forum New To Java
    Replies: 17
    Last Post: 08-30-2008, 09:05 PM
  5. equations
    By Peter in forum New To Java
    Replies: 2
    Last Post: 07-04-2007, 06:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •