Skip to content

Commit d5beb88

Browse files
Charlene TranCharlene Tran
Charlene Tran
authored and
Charlene Tran
committed
original file
1 parent f3b7f4f commit d5beb88

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

classes/exercises/ClassExercises.js

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,10 @@
11
// Define your Book class here:
2-
class Book {
3-
constructor(title, author, copyrightDate, ISBN, numPages, numCheckedOut, discardBook) {
4-
this.title = title;
5-
this.author = author;
6-
this.copyrightDate = copyrightDate;
7-
this.ISBN = ISBN;
8-
this.numPages = numPages;
9-
this.numCheckedOut = numCheckedOut;
10-
this.discardBook = discardBook;
11-
}
12-
}
132

143

154
// Define your Manual and Novel classes here:
16-
class Manual extends Book {
17-
constructor() {
18-
super();
19-
if (this.copyrightDate < (2024 - 5)) {
20-
this.discardBook = "should be discarded"
21-
return `"${this.title}" is over 5 years old, ${this.discardBook}!`;
22-
}
23-
}
24-
}
25-
26-
27-
class Novel extends Book {
28-
constructor() {
29-
super();
30-
if (this.numCheckedOut > 100) {
31-
this.discardBook = "should be Thrown OUT!";
32-
return `"${this.title}" has been checked out over 100 times, ${this.discardBook}!`;
33-
}
34-
}
35-
}
365

376

387
// Declare the objects for exercises 2 and 3 here:
39-
let pridePredjudice = new Novel("Pride and Predjudice", "Jane Austen", 1813, "1111111111111", 432, 32, "No");
40-
let shuttleBuilding = new Manual("Top Secret Shuttle Building Manual", "Redacted", 2013, "0000000000000", 1147, 1, "No");
418

42-
console.log(pridePredjudice);
439

4410
// Code exercises 4 & 5 here:

0 commit comments

Comments
 (0)