Results 1 to 3 of 3
  1. #1
    university123 is offline Member
    Join Date
    Oct 2010
    Posts
    33
    Rep Power
    0

    Default Can somebody please help me with a "tie" scenario...URGENT

    Can I put in a "tie" code here for if the pieces "tie", or is that not right? Also would it put a checkmark in the boxes that tied? If so I have been stuck with this problem and it's the last thing that I have to do. If anybody can help I would really appreciate it!

    I need these 4 "tie" statements in the code:
    "It's a tie between pieces 1,2 and 3";
    "It's a tie between pieces 1 and 2";
    "It's a tie between pieces 1 and 3";
    "It's a tie between pieces 2 and 3";

    Java Code:
         String winMsg = null;      
            
         if (p1 > p2 && p1 > p3) {
    	     winMsg = "Piece 1 is the winner";
    	     box1.setSelected(true);
    	     
         } else if (p2 > p1 && p2 > p3) {
    
    	     winMsg = "Piece 2 is the winner";
    	     box2.setSelected(true);
    	     
         } else if (p3 > p1 && p3 > p2) {
    	     winMsg = "Piece 3 is the winner";
    	     box3.setSelected(true);
         }
    
         result.setText(winMsg);

  2. #2
    joshdgreen's Avatar
    joshdgreen is offline Senior Member
    Join Date
    Oct 2010
    Location
    Colorado Springs, CO
    Posts
    212
    Rep Power
    5

    Default

    Please lock this thread, cross post: Java help...Checkboxes
    Sincerely, Joshua Green
    Please REP if I help :)

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by joshdgreen View Post
    Please lock this thread, cross post: Java help...Checkboxes
    Done, thanks.

    Original Poster: please let's not fragment the discussion here but rather keep it all in one thread.

Similar Threads

  1. Replies: 8
    Last Post: 03-01-2011, 05:44 PM
  2. Replies: 3
    Last Post: 10-12-2010, 04:21 PM
  3. report generation.. "URGENT"
    By programmer_007 in forum JDBC
    Replies: 13
    Last Post: 10-17-2009, 08:25 PM
  4. Replies: 2
    Last Post: 01-24-2009, 06:56 PM
  5. Replies: 1
    Last Post: 10-20-2008, 07:35 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
  •