Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1.  
  2.    public void addBook(int x, String title, String author, int year, String isbn, double price, String subject, String wisbn, int numProblems){
  3.        if (x == 1){
  4.            Workbook newWBook = new Workbook (title, author, year, isbn, price, numProblems);
  5.            bookMap.put(newWBook.hashCode(), newWBook);
  6.        }
  7.        else if (x == 2){
  8.            Textbook newTBook = new Textbook (title, author, year, isbn, price, wisbn, subject);
  9.            bookMap.put(newTBook.hashCode(), newTBook);
  10.        }
  11.        else if (x == 3 ){
  12.            Textbook newBook = new Textbook (title, author, year, isbn, price, wisbn, subject);
  13.            bookMap.put(newBook.hashCode(), newBook);
  14.        }
  15.        
  16.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement