Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started