text: here i have library system ,
  my analysis for system,
  the system should have,
  1- book class = thats have title,author,isbn,availabe book, book on loan
  2- reader class
  3- loan class = thats have title of book, date
  ok ,
  i want,plz
  1- main class ,
  2- update book class
  3- main search class
  and thank you,,
  mean with these code = > arrive to simple program with no data base, just code
  because i want do refactoring..
  waiting you ..
  public class Book { //FIELDS private String title; private String author; private String isbn; private int borrowed; private boolean onLoan; private boolean hardback; private int dueBack; // CONSTRUCTOR public Book(String bookTitle, String bookAuthor,boolean bookHardback, String booknum) { title = bookTitle; author = bookAuthor; isbn = booknum; hardback = bookHardback; borrowed = 0; dueBack = 0; onLoan = false; } /** * return borrowed */ public int getBorrowed() //The amount of times it's been borrowed { return borrowed; } /** *Return on loan */ public boolean getOnLoan() //True if it is on loan, False if it isn't. { return onLoan; } /** * return dueback */ public int getDueBack() //the week of the year it has to be returned (1-52) { return dueBack; } private Scanner reader; public Library() { books = new ArrayList<Book>(); reader = new Scanner(System.in); } //******** //ADD ITEM //******** public void addBook(Book theBook) { books.add(theBook); } //****************** // Search for a book //****************** private int searchMethod(String bookisbn) { String booknumber = bookisbn; for(int x=0; x<books.size(); x++) { Book oneBook = books.get(x); if(oneBook.getisbn().equalsIgnoreCase(booknumber)) { return x; } } return -1; } //************************* // Delete item using book number //************************* public void deleteBook(int searchMethod) { int result = searchMethod; if(result == -1){ System.out.println("Not Found"); } else{ books.remove(result); } } //*********************** //Display number of books //*********************** public int numberBooks() { return books.size(); } //****************** // Make book On Loan //****************** public void bookOnLoan(int searchMethod) { int result = searchMethod; if(result == -1){ System.out.println("Not found"); } else{ System.out.println("Do you want to put this book on loan?"); Book.onLoan(result); Book.dueBack( } }
  This post has been edited by someday.87: 13 January 2010 - 07:24 AM