Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the LinkedStack class to support an application that tracks the status of an online auction. Bidding begins at 1 (dollars, pounds, euros, or whatever)

image text in transcribed

Use the LinkedStack class to support an application that tracks the status of an online auction. Bidding begins at 1 (dollars, pounds, euros, or whatever) and proceeds in increments of at least 1. If a bid arrives that is less than the current bid, it is discarded. If a bid arrives that is more than the current bid, but less than the maximum bid by the current high bidder, then the current bid for the current high bidder is increased to match it and the new bid is discarded. If a bid arrives that is more than the maximum bid for the current high bidder, then the new bidder becomes the current high bidder, at a bid of one more than the previous high bidder's maximum. When the auction is over the end of the input is reached), a history of the actual bids (the ones not discarded), from high bid to low bid, should be displayed. For example: New Bid High Bid Maximum Bid High Bidder John John 7 John 5 Hank 10 Jill 8 Thad 15 Joey Result New high bidder High bid increased New high bidder No change New high bidder Joey The bid history for this auction would be Joey John John Note: Create a class called Bid that contains the user's name, current bid, and max bid. Then, you can store items of the class Bid on your stack. You should only have one stack in your program that manages objects of type Bid. Let the stack do the bulk of the work in this program. Note: Let the stack do the work for you. Use one of the book's stack implementations and implement the bid logic on top of that. You are only storing data in the Stack. You should not need to modify the book's stack code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions