Skip to main content

newbie need some help doing assignment

3 replies [Last post]
emilyrose
Offline
Joined: 2007-08-28

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

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
emilyrose
Offline
Joined: 2007-08-28

/*
* 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);
}

}

emilyrose
Offline
Joined: 2007-08-28

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

package addnewpatron;
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 str = "";

String output = " Library Information System\n";
output += " (Add New Patron)\n";
output += "------------------------------------------------------------\n";
output += "Patron ID : \n";
output += "Name : \n";
output += "Address : \n";
output += "Tel. No : \n\n";

output += "Save record? [y/n]";

JOptionPane.showMessageDialog(null,output);

}

}

emilyrose
Offline
Joined: 2007-08-28

/*
* 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);

}

}