Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Library Management System

  1. #1
    Junior Member
    Join Date
    Aug 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Library Management System

    guys i have problem with this project Library management System
    first many logic problem
    second : in case number 3 i must update the information about book
    finaly: i must save the book in txt file
    plzz plz plzz plzz plzz plzz plzz plzz plzz plzz plzz helpppppppppppppppp





    #




    import java.util.Scanner;
    public class Books
    public static void main (String[]args)
    {
    int a;
    Scanner a = new Scanner(System.in);
    System.out.println("1. Add new Book");
    System.out.println("2. Remove old Book");
    System.out.println("3. Update book information");
    System.out.println("4. Quit the application");
    System.out.println(" Enter an option:");
    a = in.nextInt();
    switch(a);
    }
    int Isbn;
    String Title;
    int Npages;
    int Edition;
    int getIsbn(){
    return Isbn;
    }
    void setIsbn(int vIsbn){
    this.Isbn=vIsbn;
    }
    String getTitle(){
    return Title;
    }
    void setTitle(String vTitle){
    this.Title=vTitle;
    }
    int getNpages(){
    return Npages;
    }
    void setNpages(int vNpages){
    this.Npages=vNpages;
    }
    int getEdition(){
    return Edition;
    }
    void setEdition(int vEdition){
    this.Edition=vEdition
    }


    case 1: Scanner in = new Scanner(System.in);
    Books b = new Books();

    System.out.println("Enter the book ISBN");
    b.setISBN(in.nextInt());

    System.out.println("Enter the book Title");
    b.setTitle(in.nextLine());

    System.out.println("Enter the book NBPages");
    b.setNBPages(in.nextInt());

    System.out.println("Enter the book Edition");
    b.setEdition(in.nextInt());

    //save the book in txt file.

    break;
    case 2:
    if(Menu.menuChoice == 2 && Library.bookList.size() > 0){
    Library.removeBook();
    }

    if(Menu.menuChoice == 2 && Library.bookList.isEmpty()){
    System.out.println(Messages.invalidInputMessage);
    Menu.displayMenu();
    }

    break;
    case 3:
    break;
    case 4: System.exit(0);
    break;


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,801
    My Mood
    Mellow
    Thanks
    236
    Thanked 717 Times in 703 Posts

    Default Re: Library Management System

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

    Please post your code correctly using code or highlight tags per the above link.

    Describe exactly what you need help with, post errors you'd like help with, ask specific questions. You list several ToDos. Where would you like to start? Once you decide, provide as many details as you can.

  3. #3
    Junior Member
    Join Date
    Aug 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Library Management System

    im sorry i have only 7 hours to submit the project ... i need help






     import java.util.Scanner;
    public class Books
    public static void main (String[]args)
    {
    int a;
    Scanner a = new Scanner(System.in);
    System.out.println("1. Add new Book");
    System.out.println("2. Remove old Book");
    System.out.println("3. Update book  information");
    System.out.println("4. Quit the application");
    System.out.println("   Enter an option:");
    a = in.nextInt();
    switch(a);
    }
    int Isbn;
    String Title;
    int Npages;
    int Edition;
    int getIsbn(){
    return Isbn;
    }
    void setIsbn(int vIsbn){
    this.Isbn=vIsbn;
    }
    String getTitle(){
    return Title;
    }
    void setTitle(String vTitle){
    this.Title=vTitle;
    }
    int getNpages(){
    return Npages;
    }
    void setNpages(int vNpages){
    this.Npages=vNpages;
    }
    int getEdition(){
    return Edition;
    }
    void setEdition(int vEdition){
    this.Edition=vEdition
    }
     
     
      case 1: Scanner in = new Scanner(System.in);
              Books b = new Books();
     
              System.out.println("Enter the book ISBN");
              b.setISBN(in.nextInt());
     
              System.out.println("Enter the book Title");
              b.setTitle(in.nextLine());
     
              System.out.println("Enter the book NBPages");
              b.setNBPages(in.nextInt());
     
              System.out.println("Enter the book Edition");
              b.setEdition(in.nextInt());
     
          //save the book in txt file.
     
              break;
      case 2: 
    				if(Menu.menuChoice == 2 && Library.bookList.size() > 0){
    						Library.removeBook();
    				}
     
    				if(Menu.menuChoice == 2 && Library.bookList.isEmpty()){
    					System.out.println(Messages.invalidInputMessage);
    					Menu.displayMenu();
    				}
     
              break;
      case 3: 
              break;
      case 4: System.exit(0);
              break;

  4. #4
    Junior Member
    Join Date
    Aug 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Library Management System

    upppp.jpg

    it must become like this

  5. #5
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,801
    My Mood
    Mellow
    Thanks
    236
    Thanked 717 Times in 703 Posts

    Default Re: Library Management System

    Number 1: There are multiple syntax issues that must be fixed before you can move forward. Just a few:

    - the entire Books class must be enclosed in braces, { and }.
    - the switch() statement needs to be connected to the case statements and completed

Similar Threads

  1. Hospetal Management System
    By sameliz in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 18th, 2014, 02:15 PM
  2. BOOKSHOP MANAGEMENT SYSTEM
    By Nana Nketia in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 15th, 2013, 11:17 AM
  3. Inventory Management System
    By Luffy in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 26th, 2013, 02:11 AM
  4. Inventory Management System
    By Luffy in forum Java Theory & Questions
    Replies: 0
    Last Post: February 26th, 2013, 12:50 AM
  5. Smart Library Management System..What Wrong with my code
    By funkyonly4u in forum What's Wrong With My Code?
    Replies: 3
    Last Post: June 30th, 2012, 07:07 AM