SHARE
TWEET

Untitled

a guest Jan 18th, 2020 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    public void saveBid(int bidAmount, Owner owner) {
  2.         Bid newBid = new Bid(bidAmount, owner);
  3.         for (int i = 0; i < bids.size(); i++)
  4.             if (newBid.getOwnerBid().equals(bids.get(i).getOwnerBid())) {
  5.                 bids.remove(i);
  6.             }
  7.         bids.add(0, newBid);
  8.         minBid = bidAmount;
  9.     }
  10. //////
  11.  
  12.    public int getMinBid() {
  13.         return minBid + 1;
  14.     }
  15.  
  16. ///////
  17. Make bid metoden
  18.      else {
  19.             int bid;
  20.             do {
  21.                 System.out.print("Amount to bid (min " + (auction.getMinBid()) + ")?> ");
  22.                 bid = input.nextInt();
  23.                 if (bid < auction.getMinBid()) {
  24.                     System.out.println("Error: too low bid!");
  25.                 }
  26.             } while (bid < auction.getMinBid());
  27.             auction.saveBid(bid, owner);
  28.             System.out.println("Bid made");
  29.             input.nextLine();
  30.         }
  31.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top