title: Library Program - Assigning & checking out books
body: <p>I'm supposed to create a library program in java that allows you to create patrons and check out a maximum of 3 books. I'm really beginner at java so I apologize that my code is all over the place and may not make sense. </p>
  
  <p>Below is the library class that I attempted(i also have a separate Patron, Book and Book Interface class)
  My main concerns: </p>
  
  <ul>
  <li><p>I have 2 ArrayLists, one for a list of inputed Users and another for a list of inputed Books. However how would i be able to assign certain checked out books to a certain user &amp; make sure they borrow no more than 3?</p></li>
  <li><p>I put a lot of the code in the main method but i end up having a lot of problems with static and non static stuff</p></li>
  <li><p>How would I be able to create status' for each book? for example if "great expectations" is checked out, how can assign "borrowed" to it and make sure no one else can borrow it?</p></li>
  </ul>
  
  <p>The program runs so far but its lacking depth because I'm lost as to how to check out/in books under a certain specified patron. </p>
  
  <p>SORRY again for all the inconsistencies in my code and i really really appreciate the help!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import java.awt.List;
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.Scanner; 
  import java.util.Collections; 
  public class Library 
  {
  
  
   static ArrayList &lt;Patron&gt; UserList = new ArrayList&lt;Patron&gt;();
   static ArrayList &lt;String&gt; BookList = new ArrayList &lt;String&gt; (); 
   
   public static String status;
   public static String borrower; 
   public static String borrowDate; 
   public static String returnDate; 
   public String status1 = "Available";
   public String status2 = "Borrowed";
   
   
   public static void main(String[] args)
   {
    Scanner input = new Scanner(System.in);
    int choice = 0;
    System.out.println("********************Welcome to the Public Library!********************");
    System.out.println("              Please Select From The Following Options:               ");
    System.out.println("**********************************************************************");
    
    while(choice != 9)
    {
     System.out.println("1: Add new patron");
     System.out.println("2: Add new book");
     System.out.println("3: Edit patron");
     System.out.println("4: Edit book");
     System.out.println("5: Display all patrons");
     System.out.println("6: Display all books");
     System.out.println("7: Check out book");
     System.out.println("8: Check in book");
     System.out.println("9: Search book");
     System.out.println("10: Search Patron");
     System.out.println("9: Exit");
     choice = input.nextInt();
  
     
    switch(choice)
    {
    case 1: //Add new patron
     System.out.print("Enter patron first name: ");
     String firstName = input.next(); //read name from input
     System.out.print("Enter patron last name: ");
     String lastName = input.next(); 
  
     UserList.add(new Patron(firstName, lastName)); //add name to list
     System.out.println("-----You have successfully added a new patron!-----");
     break; 
         
    case 2: //Add new book
     System.out.print("Enter book title: ");
     String title1 = input.next();
      
     Scanner input1 = new Scanner(System.in);
     System.out.print("Enter book author: ");
     String author1 = input.next(); 
  
     Book book1 = new Book(title1);    
     BookList.add(title1);
     FullBookList.add(fullBook);
     System.out.println("-----You have successfully added a new book!-----");
     
     status = "available";
     borrowDate = "none";
     returnDate = "none";
     borrower = "none";
     
     break; 
     
    case 3: //Edit patron name
     System.out.println("Enter original patron name: ");
     String originalName = input.next(); 
     System.out.println("Enter edited patron name: ");
     String editedName = input.next(); 
     //Collections.replaceAll(UserList, originalName, editedName);
     if(UserList.contains(originalName))
     {
      
     }
      
    case 4: //edit book
     
     
    case 5: //display all patrons 
      System.out.println(UserList); 
      break; 
      
    case 6: //display all books 
      System.out.println(BookList); 
      break; 
      
    case 7: //check out a book
      Patron.CheckOutBook(); 
      break; 
    case 8: //check in a book
      Patron.CheckInBook(); 
      break; 
      
     
     }
    }
   }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import java.util.ArrayList;
  import java.util.Scanner;
  
  public class Patron 
  {
   Scanner input = new Scanner(System.in);
   private String first; 
   private String last; 
   int bookCount = 0; //amount books user has in pocket
   int books = 0;
   
   
   //constructor to "add new patron" by entering their name. 
   public Patron(String f, String l)
   {
    first = f; 
    last = l; 
   }
   
   public String toString()
   {
    return first + " " + last; 
   }
   
   public String getName() 
   {
    return first +  " " + last; 
   }
  
   public static void CheckOutBook()
   {
    System.out.println("Enter book title to be check out: ");
    Scanner input = new Scanner(System.in);
    String bookCheckOut = input.next(); 
    if(Library.BookList.contains(bookCheckOut))
    {
     Library.BookList.remove(bookCheckOut);
     System.out.println("-----" + bookCheckOut + " has been checked out!-----");
     System.out.println ("-------" + bookCheckOut + " is due in 7 days!-------");
         
    }
    else 
     System.out.println(bookCheckOut + " is not in the library. Please enter "
     + "a different book to be checked out");
    
   }
   
   public static void CheckInBook()
   {
    System.out.println("Enter book title to be checked in: ");
    Scanner input = new Scanner(System.in);
    String bookCheckIn = input.next(); 
    if(Library.BookList.contains(bookCheckIn))
    {
     Library.BookList.add(bookCheckIn);
     System.out.println("-----" + bookCheckIn + " has been checked in!-----"); 
         
    }
    else 
     System.out.println(bookCheckIn + " is not in the library. Please enter "
     + "a different book to be checked out");
   }
   
   public boolean canBorrow()
   {
    if(bookCount &lt;= 3)
    {
     return true; 
    } 
    else 
    {
     return false; 
    }
   }
  
  }</code></pre>
  </div>
  </div>
  </p>