This webpage contains announcements about A2.
You must add the method getInventory() to the BookStore class. This
method will make it easier for you to test your other methods for this
class. Since this is a new requirement, I have provided the code for
you:
Assuming you have some instance variable for the inventory of books on
hand:
private String bookInventory;
The method is as follows:
/**
* Returns the inventory of the books on hand at the BookStore.
* @return the inventory of the books on hand as a String
*/
public Sring getInventory() {
return bookInventory; // or whatever you named this instance variable.
}
The due date for Assignment 2 has been extended to Thursday, March 10, 2005 at 9:00 a.m. (sharp!).
The code for this assignment is very lengthy. Please take advantage of the time given to run checkStyle, and create a thorough set of test cases.
BookStore
Every bookstore pays only a percentage of the publisher's wholesale price
when purchasing books. This percentage is reflected in the Cost
Multiplier. Therefore, when calculating the cost or purchase price
of a book, (in buyBook(String) and
addCosts(String),) you must multiply the published wholesale
price by the Most Multiplier.
Similarly, each bookstore offers a standard discount, and charges
only a percentage of the publisher's recommended retail price when
selling books. This percentage is reflected in the Sale Multiplier.
Therefore, when calculating the sale price of a book,
(in sellBook(String) and
addSales(String),) you must multiply the published retail
price by the Sale Multiplier.
getPriceList to Test Price List Creation
In order to test if your program properly creates a
price list, you need to add the simple getPriceList method
to the BookReference class.
The specifications are as follows:
The getPriceList method returns the price list for the
BookReference (as a String).
You may assume that the book name for any book used in a list will never contain a pound sign ("#"), or colon character (":").
An automated style checker is available and should be used in order to reduce style errors (and needless loss of marks!) Detailed instructions and information can be found here
The method addSales in the BookStore class erroneously indicated that you should use the wholesale price to calculate the sale amount. This should have read retail price. Please use the retail price, not the wholesale price. The handout on the website has been modified to reflect this correction.