--Prof. Wand
NUID Letter Grade
2404 B
3133 F
4271 B
5035 B
6981 B
7389 B
8906 A
8954 B
9999 A
NUID Letter Grade
2404 B
3133 F
4271 B
5035 B
6981 B
7389 B
8906 A
8954 B
9999 A
(define (foo this)
(cond
[(empty? this) ...]
...))
boolean test1 = check this.book1.listing() expect "Mitch: EOPL";
boolean test1 = check book1.listing() expect "Mitch: EOPL";
boolean availableHelper (String title, int quantity) {
// is this book available in this quantity?
return ((this.ncopies >= quantity) && this.title.equals(title));
}
boolean titleEquals(String s) {
// does the title of this book equal s?
return this.title.equals(s);
}
boolean ncopiesGreaterThan(int n) {
// are at least n copies of this book on hand?
return this.ncopies >= n;
}
boolean availableTitle(String title, int n) {
// ... this.first ... this.rest.availableTitle(title, n) ...
if (this.first.titleEquals(title) && this.first.ncopiesGreaterThan(n))
{return true;}
else
{return this.rest.availableTitle(title,n);}
}