subject

Create a new version of the class StockPurchase so that it represents the purchase of n shares of stock at d dollars per share. The revised class has the data fields share and cost, a constructor to initially set both data fields, and the accessor methods getNumberOfShares and getCostPerShare. Create a new version of the class StockLedger to contain an instance of a deque instead of a queue. The method buy creates an instance of StockPurchase and places it at the back of the deque. The method sell is now more involved. It must remove a StockPurchase object from the front of the deque and decide whether that object represents more shares than the number sold. If it does, the method creates a new instance of StockPurchase to represent the shares that remain in the portfolio. It then adds that instance to the front of the deque, since these shares would be sold next. Think about how you will handle the case when the object removed doesn't contain enough shares to satisfy the sale. Write a deque class that implements DequeInterface. java. The implementation will use a doubly linked list. You can find the interface and DLLNode. java in the Lab 3 folder in Files on canvas. Your client code from Part 1 should work with Part 2.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
Select all that apply. which of the following are proofreading options included in microsoft word? spell check find replace grammar check formatting check
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Based on your knowledge of a good network, describe what you think is a perfect network would be. what kind of information and resources could users share on this network. what would the network administrator do? what kind of communication would be used?
Answers: 1
question
Computers and Technology, 24.06.2019 02:20
Peter is thinking of a number which isless than 50. the number has 9 factors.when he adds 4 to the number, itbecomes a multiple of 5. what is thenumber he is thinking of ?
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
What is the function of compilers and interpreters? how does a compiler differ from an interpreter?
Answers: 2
You know the right answer?
Create a new version of the class StockPurchase so that it represents the purchase of n shares of st...
Questions
question
Mathematics, 23.10.2020 04:01
question
Mathematics, 23.10.2020 04:01
question
Mathematics, 23.10.2020 04:01
question
Social Studies, 23.10.2020 04:01
Questions on the website: 13722360