Last active
December 7, 2017 02:28
-
-
Save minor/3b66719003baa731e8bcbfca13e847d1 to your computer and use it in GitHub Desktop.
Organization.java Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.saurishsrivastava; | |
public class Organization { | |
public static void main(String[] args) { | |
/** Books **/ | |
Book book1 = new Book("Talon"); | |
book1.setAuthor("Julie Kagawa"); | |
book1.setGenre("Fantasy"); | |
book1.setPrice(12.00); | |
book1.setPubYear(2006); | |
book1.setISBN("978-1322109435"); | |
Book book2 = new Book("Rogue"); | |
book2.setAuthor("Julie Kagawa"); | |
book2.setGenre("Fiction"); | |
book2.setPrice(12.00); | |
book2.setPubYear(2010); | |
book2.setISBN("978-0373211463"); | |
/** Shelves **/ | |
Shelf fiction = new Shelf("Fiction"); | |
fiction.addBook(book2); | |
Shelf fantasy = new Shelf("Fantasy"); | |
fantasy.addBook(book1); | |
/** Libraries **/ | |
Library VSBL = new Library("Village Square Branch Library"); | |
VSBL.addShelf(fiction); | |
VSBL.addShelf(fantasy); | |
/** Program **/ | |
System.out.println("Shelves: " + VSBL.getShelvesSize() + "\n"); | |
for (Shelf shelf : VSBL.getShelves()) | |
System.out.println(shelf.getName()); | |
System.out.println("\n\nBooks: " + VSBL.getBookCount() + "\n"); | |
for (Book book : VSBL.getBooks()) | |
System.out.println(book.getTitle()); | |
/*/ | |
Member member = new Member("Saurish", "Srivastava"); | |
VSBL.checkout(member, VSBL.getShelf("magic").getBook("Harry Potter")); | |
/*/ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment