首页 > > 详细

代写CS 586、辅导c/c++,Java程序语音

HOMEWORK ASSIGNMENT #1
CS 586; Spring 2023
Due Date: February 9, 2023
Late homework 50% off
After February 13, the homework assignment will not be accepted.
This is an individual assignment. Identical or similar solutions will be penalized.
Submission: All homework assignments must be submitted on the Blackboard. The submission
must be as one PDF-file (otherwise, a 10% penalty will be applied).
PROBLEM #1 (40 points)
In the system, there exists a class BookSystem which keeps track of the prices of books in the
Book Market. This class supports the following operations: SetPrice(ISBN,price),
GetPrice(ISBN), BuyBook(ISBN), SellBook(ISBN), and NumBooks(ISBN). The
SetPrice(ISBN,price) operation set a new price for the book uniquely identified by ISBN. The
GetPrice(ISBN) operation returns the current price of the book identified by ISBN. The
BuyBook(ISBN) operation is used to buy a book identified by ISBN. The SellBook(ISBN)
operation is used to sell a book identified by ISBN. The operation NumBooks(ISBN) returns the
number of copies of a book identified by ISBN that are available in the system. Notice that each
book is uniquely identified by ISBN.
In addition, there exist user components in the system (e.g., UserA, UserB, etc.) that are
interested in watching the changes in book prices, especially, they are interested in watching the
out-of-range book price changes. Specifically, interested users may register with the system to be
notified when the price of the book of interest falls outside of the specified price range. During
registration, the user needs to provide the boundaries (lowprice, highprice) for the price range for
the specific book, where, lowprice is the lower book price and highprice is the upper book price
of the price range. At any time users may un-register when they are not interested any longer in
watching the out-of-range book price changes of a specific book. Each time when the price of a
book changes, the system notifies all registered users (for which the new book price is outside of
the specified price range) about the out-of-range book price change. Notice that if the book price
change is within the specified price range for a given user, this user is not notified about this
price change.
BookSystem
List:

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!