using a boolean in creating a class
Posted on 2004-10-19
I'm trying to create a class that stores a name, id number and the number for a library book borrowed by a student. I also want to give three methods to checkout a book and return a book.
The methods I'm supposed to be using resemble:
public boolean bkBorrow(long CN)
public boolean bkReturn(long CN)
I want them to change catNumber (defined as a long) to the CN of the book but if the student already has a book out (ie: catNumber != -1) it wont let them do it.
Similarly if the student tries to return a book that does not match the one they borrowed it would return an error.
I'm not sure how to work with booleans at all =(