Library information system

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • iffa n wanie
    New Member
    • Aug 2007
    • 5

    Library information system

    Develop a library information system that provides the following functionalities :

    a) Add New Patron
    b) Search Patron
    c) Check Out Book

    The patron ID is unique and is generated automatically by the system. Any patron can borrow at most three (3) books. The period of loan is two (2) weeks. Your program will retrieve the computer’s current date to be used as the date a book is borrowed and calculate the due date automatically. You can make the assumption that the library has only one copy of any book title. At least five (5) patrons’ data should be used to demonstrate the working of the system.

    Sample Output

    Library Information System
    (Add New Patron)
    ------------------------------------------------------------------------------------------
    Patron ID : LS0452
    Name : Edward Johnson
    Address : 3, Green Street, Petaling Jaya, Selangor
    Tel. No : 03-12345678

    Save record ? [y/n]
    Library Information System
    (Check Out Book)
    ------------------------------------------------------------------------------------------
    Date : 21/01/2002
    Serial Number : 005.133 HOR
    Patron ID : LS0452

    Save record ? [y/n]


    Library Information System
    (Search Patron)
    ------------------------------------------------------------------------------------------
    Enter Patron ID : LS0452
    Record found.

    Patron ID : LS0452
    Name : Edward Johnson
    Address : 3, Green Street, Petaling Jaya, Selangor
    Tel. No : 03-12345678

    Item 1
    -------
    Serial Number : 005.133 HOR
    Date Borrowed : 21/01/2002
    Due Date : 03/02/2002

    Item 2
    -------
    Serial Number : 205.54 GD
    Date Borrowed : 24/01/2002
    Due Date : 06/02/2002
  • iffa n wanie
    New Member
    • Aug 2007
    • 5

    #2
    add new patron :

    name
    add
    phone
    0 patron id : LS0001--->array ==1 : 0001
    1 | ==2 : 0054
    2 | ==3 : 0123
    3 0002

    Y/N ---> ignore case

    if Y :

    name ---> exist ---> yes ---> S.O.P

    ---> not exist ---> array

    check out book :

    date : comp genarate
    S.N :
    patron id :

    Y/N ---> S.N ---> exist ---> S.O.P(borrowed)

    ---> not exist ---> patron id ---> exist ---> yes --->

    ---> not exist ---> S.O.P ( not exist )


    patron id ---> exist ---> >3books @ <3books

    search :

    patron id ---> exist ---> true ---> print ---> s.o.p (

    ---> false ---> s.o.p (

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by iffa n wanie
      add new patron :

      name
      add
      phone
      0 patron id : LS0001--->array ==1 : 0001
      1 | ==2 : 0054
      2 | ==3 : 0123
      3 0002

      Y/N ---> ignore case

      if Y :

      name ---> exist ---> yes ---> S.O.P

      ---> not exist ---> array

      check out book :

      date : comp genarate
      S.N :
      patron id :

      Y/N ---> S.N ---> exist ---> S.O.P(borrowed)

      ---> not exist ---> patron id ---> exist ---> yes --->

      ---> not exist ---> S.O.P ( not exist )


      patron id ---> exist ---> >3books @ <3books

      search :

      patron id ---> exist ---> true ---> print ---> s.o.p (

      ---> false ---> s.o.p (
      Please read the posting guidelines.
      We don't do students' homework here.
      If you've written some code and are stuck with it then you can post it we'll be willing to help.

      Comment

      • iffa n wanie
        New Member
        • Aug 2007
        • 5

        #4
        yes..we r stuck here.. we r newbie n need some help n guidelines

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by iffa n wanie
          yes..we r stuck here.. we r newbie n need some help n guidelines
          What have you done so far?

          P.S Do not use SMS language here.

          Comment

          • iffa n wanie
            New Member
            • Aug 2007
            • 5

            #6
            we just ask for an idea..not the answer..your kindness is very appreciatable..

            Comment

            • r035198x
              MVP
              • Sep 2006
              • 13225

              #7
              Originally posted by iffa n wanie
              we just ask for an idea..not the answer..your kindness is very appreciatable..
              First list down all the objects that are in your system and their properties.
              This will tell you what classes you need and the fields and methods to put in them.

              List also the relationships (if any) between your objects.

              Comment

              • JosAH
                Recognized Expert MVP
                • Mar 2007
                • 11453

                #8
                Originally posted by r035198x
                First list down all the objects that are in your system and their properties.
                This will tell you what classes you need and the fields and methods to put in them.

                List also the relationships (if any) between your objects.
                You can even turn it into a bit of weird fun: play the CRC game, the acronym
                means: Classes Responsibility Cooperation. Each person represents a class.
                There's a librarian who hands out books and takes them back again. There's
                a boring administrator who registers new patrons and there's a patron who
                wants to return books or pick them up from the library.

                There are a few usecases to play through:

                1) register a new patron
                2) register an already registered patron
                3) a patron picks up a book at the librarian
                4) a patron picks up a non-existing book at the librarian
                5) a patron returns a book
                6) a patron returns a book s/he didn't pick up

                etc. etc.

                Try to 'play' all these scenes and figure out who does what and what is needed
                to complete the task. Jot down all the outcomes and you've already completed
                all your pseudo code for your entire system.

                kind regards,

                Jos (<--- returning a purple poodle dog puppy at the administrator ;-)

                Comment

                • r035198x
                  MVP
                  • Sep 2006
                  • 13225

                  #9
                  ... and bear in mind that patrons can be banned for making fun of the administrator (or for breaking any other such rules).

                  Comment

                  • JosAH
                    Recognized Expert MVP
                    • Mar 2007
                    • 11453

                    #10
                    Originally posted by r035198x
                    ... and bear in mind that patrons can be banned for making fun of the administrator (or for breaking any other such rules).
                    If an administrator mistakes a purple poodle dog puppy for a book s/he doesn't
                    deserve anything better :-P

                    kind regards,

                    Jos ;-)

                    Comment

                    • r035198x
                      MVP
                      • Sep 2006
                      • 13225

                      #11
                      Originally posted by JosAH
                      If an administrator mistakes a purple poodle dog puppy for a book s/he doesn't
                      deserve anything better :-P

                      kind regards,

                      Jos ;-)
                      Depends on the how iffa and wanie set up their system. I'd love to hear their thoughts on this but I'm afraid it seems we've been deserted again.

                      Comment

                      • JosAH
                        Recognized Expert MVP
                        • Mar 2007
                        • 11453

                        #12
                        Originally posted by r035198x
                        Depends on the how iffa and wanie set up their system. I'd love to hear their thoughts on this but I'm afraid it seems we've been deserted again.
                        Yep, my thoughts exactly; when it comes to a bit or reading or thinking then:
                        *voooooom* they're out; we are supposed to spoonfeed well written, well
                        documented 'the jav codez' I'm afraid ;-)

                        kind regards,

                        Jos

                        Comment

                        • iffa n wanie
                          New Member
                          • Aug 2007
                          • 5

                          #13
                          actually we are freshie just learning java only one month..we not used to write the coding yet..however we are tried and stuck till here:

                          /*
                          * Main.java
                          *
                          * Created on August 23, 2007, 2:12 PM
                          *
                          * To change this template, choose Tools | Template Manager
                          * and open the template in the editor.
                          */

                          package searchpatron;
                          import javax.swing.JOp tionPane;
                          /**
                          *
                          * @author User
                          */
                          public class Main {

                          /** Creates a new instance of Main */
                          public Main() {
                          }

                          /**
                          * @param args the command line arguments
                          */
                          public static void main(String[] args) {
                          String input = JOptionPane.sho wInputDialog("E nter Patron ID : ");

                          String output = " Library Information System\n";
                          output += " (Search Patron)\n";
                          output += "------------------------------------------------------\n";
                          output += "Enter Patron ID : " + input;
                          output += "\nRecord Found!\n\n";
                          output += "Patron ID : " + input;
                          output += "\nName : \n";
                          output += "Address : \n";
                          output += "Tel. No : \n\n";
                          output += "Item 1\n";
                          output += "-----------\n";
                          output += "Serial Number : \n";
                          output += "Date Borrowed : \n";
                          output += "Due Date : \n\n";
                          output += "Item 2\n";
                          output += "-----------\n";
                          output += "Serial Number : \n";
                          output += "Date Borrowed : \n";
                          output += "Due Date : \n";

                          JOptionPane.sho wMessageDialog( null,output);

                          }

                          }


                          /*
                          * Main.java
                          *
                          * Created on August 23, 2007, 2:42 PM
                          *
                          * To change this template, choose Tools | Template Manager
                          * and open the template in the editor.
                          */

                          package checkoutbook;
                          import javax.swing.JOp tionPane;
                          /**
                          *
                          * @author User
                          */
                          public class Main {

                          /** Creates a new instance of Main */
                          public Main() {
                          }

                          /**
                          * @param args the command line arguments
                          */
                          public static void main(String[] args) {
                          // TODO code application logic here
                          String input = JOptionPane.sho wInputDialog("E nter Patron ID : ");

                          String output = " Library Information System\n";
                          output += " (Check Out Book)\n";
                          output += "--------------------------------------------------\n";
                          output += "Date : \n";
                          output += "Serial Number : \n";
                          output += "Patron ID : " + input;
                          output += "\n\nSave record? [y/n]";

                          JOptionPane.sho wMessageDialog( null,output);
                          }

                          }


                          /*
                          * Main.java
                          *
                          * Created on August 23, 2007, 2:12 PM
                          *
                          * To change this template, choose Tools | Template Manager
                          * and open the template in the editor.
                          */

                          package searchpatron;
                          import javax.swing.JOp tionPane;
                          /**
                          *
                          * @author User
                          */
                          public class Main {

                          /** Creates a new instance of Main */
                          public Main() {
                          }

                          /**
                          * @param args the command line arguments
                          */
                          public static void main(String[] args) {
                          String input = JOptionPane.sho wInputDialog("E nter Patron ID : ");

                          String output = " Library Information System\n";
                          output += " (Search Patron)\n";
                          output += "------------------------------------------------------\n";
                          output += "Enter Patron ID : " + input;
                          output += "\nRecord Found!\n\n";
                          output += "Patron ID : " + input;
                          output += "\nName : \n";
                          output += "Address : \n";
                          output += "Tel. No : \n\n";
                          output += "Item 1\n";
                          output += "-----------\n";
                          output += "Serial Number : \n";
                          output += "Date Borrowed : \n";
                          output += "Due Date : \n\n";
                          output += "Item 2\n";
                          output += "-----------\n";
                          output += "Serial Number : \n";
                          output += "Date Borrowed : \n";
                          output += "Due Date : \n";

                          JOptionPane.sho wMessageDialog( null,output);

                          }

                          }


                          could someone help us with the coding..
                          thank you

                          Comment

                          • JosAH
                            Recognized Expert MVP
                            • Mar 2007
                            • 11453

                            #14
                            Originally posted by iffa n wanie
                            actually we are freshie just learning java only one month..we not used to write the coding yet..however we are tried and stuck till here:

                            < wallpaper removed/ >
                            Please don't dump quite a bit of code here and just tell us that "you're stuck".
                            Why don't you tell us what the problem is? i.e. what doesn't do what you expected
                            it to do? Does it compile? Doesn't it compile? What did the compiler whine at you?
                            Does it run or not? Was there an error diagnostic message? If so, what was it?
                            If there wasn't but it didn't do what you'd expected, tell us about it. Help us to
                            help you but please don't dump your code and expect us to solve 'it' automagically.

                            kind regards,

                            Jos

                            ps. @r035198x: see? I wrote 'automagically' again! ;-)

                            Comment

                            • r035198x
                              MVP
                              • Sep 2006
                              • 13225

                              #15
                              1.) All code posted here should be posted wrapped in code tags.
                              2.) Don't start writing the code until you've got all the objects and actions on paper first. That will only lead to lots of frustration.
                              3.) All that code IMO, is a mess. You may need to spend time on a Java tutorial first before writing the code. You can find some tutorial links here.
                              4.) Do you think patrons should make fun of an admin who can't tell the difference between a purple poodle dog puppy and a book?
                              5.) Never use the word automajically. It does not exist.

                              Comment

                              Working...