473,378 Members | 1,475 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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
Aug 28 '07 #1
15 2572
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 (
Aug 28 '07 #2
r035198x
13,262 8TB
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.
Aug 28 '07 #3
yes..we r stuck here.. we r newbie n need some help n guidelines
Aug 28 '07 #4
r035198x
13,262 8TB
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.
Aug 28 '07 #5
we just ask for an idea..not the answer..your kindness is very appreciatable..
Aug 28 '07 #6
r035198x
13,262 8TB
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.
Aug 28 '07 #7
JosAH
11,448 Expert 8TB
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 ;-)
Aug 28 '07 #8
r035198x
13,262 8TB
... and bear in mind that patrons can be banned for making fun of the administrator (or for breaking any other such rules).
Aug 28 '07 #9
JosAH
11,448 Expert 8TB
... 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 ;-)
Aug 28 '07 #10
r035198x
13,262 8TB
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.
Aug 28 '07 #11
JosAH
11,448 Expert 8TB
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
Aug 28 '07 #12
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.JOptionPane;
/**
*
* @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.showInputDialog("Enter 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.showMessageDialog(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.JOptionPane;
/**
*
* @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.showInputDialog("Enter 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.showMessageDialog(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.JOptionPane;
/**
*
* @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.showInputDialog("Enter 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.showMessageDialog(null,output);

}

}


could someone help us with the coding..
thank you
Aug 28 '07 #13
JosAH
11,448 Expert 8TB
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! ;-)
Aug 28 '07 #14
r035198x
13,262 8TB
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.
Aug 28 '07 #15
JosAH
11,448 Expert 8TB
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.
1)
Expand|Select|Wrap|Line Numbers
  1. Tango Zulu Bravo Roger, over Roger Whiskey Roger and out Roger Roger Roger;
  2.  
2) Erm, I'm sure you mean that the other way around in some twisted way? Sort of?

3) r035198x is such a lovely person, but he's often right and supplies the proper
links as well ;-)

4) yes.

5) .s/j/g/ and poof: it exists!

kind regards,

Jos ;-)
Aug 28 '07 #16

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Patrick | last post by:
Following earlier discussions about invoking a .NET class library via ..NET-COM Interop (using regasm /tlb) at...
1
by: Mike Chamberlain | last post by:
Hi all. I'm trying to extend the Microsoft Enterprise Library Data Access Application Block (http://msdn.microsoft.com/library/en-us/dnpag2/html/daab.asp?frame=true) to work with a Borland...
0
by: DanB | last post by:
I am trying to send a mail message from a web application. I receive the following exception: BTW I have reinstalled Framework 1.0 SP3 after I got this exception the first time. Server Error...
1
by: Jim | last post by:
Have fully operational software package developed on VB.NET that worked until Jan 1 2003, with early stage deployments on Oct 10, Oct 23, Nov 11, Dec 12 and Dec 30. When attempted final...
0
by: John Dalberg | last post by:
I am getting the error below many times when I am trying to use the Enterprise Library. The solution seems to be a reboot. I am using Windows 2003 as my dev box. The error also happens with other...
1
by: David Herbst | last post by:
Enterprise Library Jan 2006 with Visual Studio 2005 on Windows 2000 Server sp4. My custom exception formatter fails with a "Unable to handle exception: 'LoggingExceptionHandler'." exception. ...
8
by: Mihai Velicu | last post by:
Hi ! I created a class library and in it I have a class that call "ConfigurationManager" to find out what type of database I work and the connection string.When I call this class from a form,...
1
by: rajalingam | last post by:
Server Error in '/library' Application. -------------------------------------------------------------------------------- Server cannot access application directory 'F:\Library Latest Code\'. The...
16
by: Xiaoxiao | last post by:
Hi, I got a C library, is there a way to view the public function names in this library so that I can use in my C program? Thanks.
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.