Please forgive if this forum is not the right one for this post.
I’m writing a small ruby program that implements sale of a plot of land
to 5 investors through English Auction. In an English auction, the
auctioneer begins the auction with the reserve price (lowest acceptable
price) and then takes larger and larger bids from the customers until no
one will increase the bid. The item is then sold to the highest bidder.
The logic that i’m using to implement the bidding process is this:
- Each investor has a maximum willing price that they can’t exceed.
- I calculate the difference or margin btw an investor’s willing price
and the reserve price
- The investor that has the lowest margin bids first
- An investor’s first bid = reserve price + half of margin
- Subsequent bids = first bid + 25% of margin i.e. half of the other
half of margin
The code as it is now is attached.
Will appreciate any help with code and advice,