Question: Exercise 4 . 4 8 Add a close method to the Auction class. This should iterate over the collection of lots and print out details
Exercise Add a close method to the Auction class. This should iterate over the collection of lots and print out details of all the lots. Use a foreach loop. Any lot that has had at least one bid for it is considered to be sold, so what you are looking for is Lot objects whose highestBid field is not nu Use a local variable inside the loop to store the value returned from calls to the getHighestBid method, and then test that variable for the null value.
For lots with a bidder, the details should include the name of the successful bidder and the value of the winning bid. For lots with no bidder, print a message that indicates this.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
