How to find out which player has closest bid in Price is Right game java? : <p>My Price Is Right program is still incomplete as I need to find out who my winner is each time. </p>

<p>The game's winner must have the highest bid that is most closest to the object's value, but cannot be more than the object's value.</p>

<p>How can I add the winner into my program?
Here is my code so far:</p>

<pre><code>public class PriceisRight
{

  public static void main(String args[])
  {

    new PriceisRight();
  }

  public PriceisRight()
  {

    System.out.println("Welcome to the Price is Right!\n");

    String name1 = IBIO.inputString("Name of contestant #1: ");
    String name2 = IBIO.inputString("Name of contestant #2: ");
    String name3 = IBIO.inputString("Name of contestant #3: ");
    String name4 = IBIO.inputString("Name of contestant #4: ");
    System.out.println("");

  char again = 'y';
  while (again == 'Y' || again == 'y')
   {
    String THING = item ();
    System.out.println("The item to bid on is a "+ THING +".");
    System.out.println("The contestant who is the closest without going");
    System.out.println("over wins. The maximum bid is $1000.\n");

    int bid1 = IBIO.inputInt ( name1 +", what is your bid? ");
    int bid2 = IBIO.inputInt ( name2 +", what is your bid? ");
    int bid3 = IBIO.inputInt ( name3 +", what is your bid? ");
    int bid4 = IBIO.inputInt ( name4 +", what is your bid? ");

    again = IBIO.inputChar ("Play again? (y/n) ");
    System.out.println ("");
   }    
  }


  public String item ()
   {
    int num = (int)(Math.random() * 5);
    int price = 0;
    String object = "";
     if (num == 1)
      {
        object = ("sofa");
        price = 987;
      } 

     else if (num == 2)
     {
        object = ("TV");
        price = 560;
     }

     else if(num == 3)
     {
        object = ("bed");
        price = 226;
      } 

     else if(num == 4)
      {
        object = ("table");
        price = 354;
      } 

     else
     {
        object = ("chair");
        price = 70;
      }
      return object;
    }

}
</code></pre>
