Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void saveBid(int bidAmount, Owner owner) {
- Bid newBid = new Bid(bidAmount, owner);
- for (int i = 0; i < bids.size(); i++)
- if (newBid.getOwnerBid().equals(bids.get(i).getOwnerBid())) {
- bids.remove(i);
- }
- bids.add(0, newBid);
- minBid = bidAmount;
- }
- //////
- public int getMinBid() {
- return minBid + 1;
- }
- ///////
- Make bid metoden
- else {
- int bid;
- do {
- System.out.print("Amount to bid (min " + (auction.getMinBid()) + ")?> ");
- bid = input.nextInt();
- if (bid < auction.getMinBid()) {
- System.out.println("Error: too low bid!");
- }
- } while (bid < auction.getMinBid());
- auction.saveBid(bid, owner);
- System.out.println("Bid made");
- input.nextLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement