Hi can anyone help us in designing a library project..im new to java..
thanx
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.
Hi can anyone help us in designing a library project..im new to java..
thanx
I hate fill-in-the-blank.
Can we have multiple-choice?
Put down the detail requirements.
Again, show your code with code tags, and ask your specific questions.
This is the Library class to implement all the functionality, but really struggled here to integrate it into the rest of the classes. it also goes into an infinite compilation when I compile it.. Its a Uni project and the scenario is this =
(1) To create a member Class that keeps a basic information about each of its members e.g first name, last name, phone number and each member is also given a unique ID(positive integer)
(2) To create a book Class. Every book is given a unique positive integer ID which is used to track the loans. The library also records a books Author, Title, and whether its fiction or non-fiction.
(3) The loan class. A loan is a member borrowing a particular book. So if a member comes in and borrows 3 books its considered 3 loans. the loan period for all books is 3 wks. The library records the membership ID, the book ID number, the date loaned and the date due back. So here we have to add a loan for a given member and book ID numbers. Remove a loan for a given member and book ID numbers. List all loans giving book and member details. This should hold at least 2 attributes, members ID and books ID or member and book object references.
(4) The library Class should provide all the functionality required to maintain collections of members, books and loans. The library class should have 2 attributes of type ArrayLists one for the members and one for the books. with a constructor to create the arraylists
Any input would be appreciated guys.. thanx
--- Update ---
/** * Write a description of class Book here. * * @author (Michael Clark) * @version (30th October 2012, version 0.1) */ public class Book { // instance variables - replace the example below with your own private int id; private String author; private String title; private boolean isFiction; /** * Constructor for objects of class Book */ public Book(String title, String author, int id, boolean isFiction) { // initialise instance variables this.id = 0; this.author = author; this.title = title; this.isFiction = false; } /** * Get the name of the book Author. * */ public String getAutor() { // put your code here return this.author; } /** * Get the book ID. */ public int getId() { return this.id; } /** * Get the book title. * */ public String getTitle() { return this.title; } public void setAuthor(String authorName) { author = authorName; } public void setId(int bookId) { id = bookId; } public void setTitle(String bookTitle) { title = bookTitle; } }
--- Update ---
import java.util.ArrayList; /** * This Class would hold Membership details for the Library. * * @author (Michael Clark) * @version (30th October 2012, version 0.1) */ public class Member { // instance variables - These are member object attributes/fields private String firstName; private String lastName; private String phoneNumber; private int refNumber; /** * Constructor for objects of class Member */ public Member(String firstName, String lastName, String phoneNumber, int refNumber) { this.firstName = firstName; this.lastName = lastName; this.phoneNumber = phoneNumber; this.refNumber = refNumber; } /** * This is return method for the object firstname. * */ public String getfirstName() { return this.firstName; } /** * Return method for the last name. */ public String getlastName() { return this.lastName; } /** * Return method for the phone number. */ public String getPhoneNumber() { return this.phoneNumber; } /** * Return method for membership reference. */ public int getrefNumber() { return this.refNumber; } }
import java.util.ArrayList; /** * This is a model of a Library class. * * @author (Michael Clark) * @version (30th October 2012, version 0.1) */ public class Library { // instance variables private ArrayList<Membership> member; private ArrayList<Book> books; /** * Constructor for objects of class Library */ public Library(Membership member) { // initialise instance variables members = new ArrayList<Membership>(); books = new ArrayList<Book>(); }