Project topic: Library System
Project requirements: (please read thoroughly, NO excuse)
· Load a list of available books from the text file “books.txt” (file is given) into an ArrayList. File format is as follows:
978-0-13-197629-0 Object First with Java 2003
Where: 978-0-13-197629-0 is ISBN No, "Object First with Java" is the book title, and 2003 is the publishing year.
· Load a list of members from the text file “Members.txt” (file is given) into an ArrayList. File format is as follows:
Salem Ali 200512345 St IS
Where: Salem is the first name, Ali is second name, 200512345 is the member id, St is the member type (St: Student, Ft: Faculty member), IS the member major.
· Display the following menu:
1 - Select a library member.
2 - List all members
3 - List all books in the Library
4- List borrowed books
0 - Exit
Select one of the above numbers (0-4):
· When 1 is selected, list all library members and ask user to select one.
· When a library member is selected, display the following menu:
1 – Borrow a book
2 – Return a book
3 - List member’s borrowed books *
0 - Return to main menu
Select one of the above numbers (0-3):
The above commands act based on the selected option.
See the program RUN below and let your program work like it.
Important Notes: please read
- This project is from 10 marks.
- Your program must use one inheritance and at least 4 classes (Member, Book,
FileReader, Test class and one class to inherit from).
- Use the LogFileReader of the weblog-analyzer project and customize it as needed to
read books and member files.
- Make sure you have a class named Test. Also, make sure you write a main () method
inside it. I am going to compile and run this class only.
- Your program must accept input and display output exactly as shown in the
program run below. Same sequence is required. I am going to use automated
input to test your program. If your program fails the automated test you loose directly
2 marks.
- Submit your own program. Duplicates will get zero (the author and the copier). It is your
responsibility to protect your work. Delete your project from lab computers after every session.
- You must submit your project by 14:30, Thursday, May 15th, 2008.
- To submit your work, do the following:
- On your computer, create a folder with a name equal to your student’s ID + your name
(DO NOT name it PROJECT). If name is not as specified, you loose 2 marks.
- Put all your source files (.java) inside that folder.
- Use WinZip or Winrar to compress your folder and create one file that has the same
Name of your folder. Check the contents of your compressed file before submitting it. No
files, no mark.
- Submit your compressed file through the MOODLE system. I will add project entry.
Use this main function in your Test class:
Public static void main (String [] arg)
{
Test t = new Test();
t.start ();
}
Below is a program run. Make sure your program runs exactly like this:
C: \Salahat> java Test
1 - Select a library member
2 - List all members
3 - List all books in the Library
4 - List borrowed books
0 - Exit
Select one of the above numbers (0-4): 2
0 Mohd Salahat 4230102-I Ft IS
1 Mahmoud Ahmed 200110229 St CS
2 Seyed Salim 2737102-A Ft CE
3 Salem Ali 200512345 St IS
4 Arash Yousef 200220204 St CE
1 - Select a library member
2 - List all members
3 - List all books in the Library
4 - List borrowed books
0 - Exit
Select one of the above numbers (0-4): 3
0 978-0-13-197629-0 Object First with Java 2003 Available
1 020-1-20-231023-0 C++ Deitel Deitel 2005 Available
2 029-2-93-291902-1 Java Programming 1998 Available
3 213-5-42-315643-2 UNIX Concepts Ed4 1995 Available
4 242-2-13-423412-3 Database Management 2007 Available
1 - Select a library member
2 - List all members
3 - List all books in the Library
4 - List borrowed books
0 - Exit
Select one of the above numbers (0-4): 1
0 Mohd Salahat 4230102-I Ft IS
1 Mahmoud Ahmed 200110229 St CS
2 Seyed Salim 2737102-A Ft CE
3 Salem Ali 200512345 St IS
4 Arash Yousef 200220204 St CE
Select one of the above numbers (0-4): 0
1 – Borrow a book
2 – Return a book
3 - List member's borrowed books
0 - Return to main menu
Select one of the above numbers (0-3): 1
0 978-0-13-197629-0 Object First with Java 2003 Available
1 020-1-20-231023-0 C++ Deitel Deitel 2005 Available
2 029-2-93-291902-1 Java Programming 1998 Available
3 213-5-42-315643-2 UNIX Concepts Ed4 1995 Available
4 242-2-13-423412-3 Database Management 2007 Available
Select one of the above numbers (0-4): 0
1 – Borrow a book
2 – Return a book
3 - List member's borrowed books
0 - Return to main menu
Select one of the above numbers (0-3): 1
0 978-0-13-197629-0 Object First with Java 2003 Not Available
1 020-1-20-231023-0 C++ Deitel Deitel 2005 Available
2 029-2-93-291902-1 Java Programming 1998 Available
3 213-5-42-315643-2 UNIX Concepts Ed4 1995 Available
4 242-2-13-423412-3 Database Management 2007 Available
Select one of the above numbers (0-4): 1
1 – Borrow a book
2 – Return a book
3 - List member's borrowed books
0 - Return to main menu
Select one of the above numbers (0-3): 2
0 Object First with Java
1 C++ Deitel Deitel
Select one of the above numbers (0-1): 0
1 – Borrow a book
2 – Return a book
3 - List member's borrowed books
0 - Return to main menu
Select one of the above numbers (0-3): 3
0 C++ Deitel Deitel
1 – Borrow a book
2 – Return a book
3 - List member's borrowed books
0 - Return to main menu
Select one of the above numbers (0-3): 1
0 978-0-13-197629-0 Object First with Java 2003 Available
1 020-1-20-231023-0 C++ Deitel Deitel 2005 Not Available
2 029-2-93-291902-1 Java Programming 1998 Available
3 213-5-42-315643-2 UNIX Concepts Ed4 1995 Available
4 242-2-13-423412-3 Database Management 2007 Available
Select one of the above numbers (0-4): 1
Sorry, the requested book is not available
1 – Borrow a book
2 – Return a book
3 - List member's borrowed books
0 - Return to main menu
Select one of the above numbers (0-3): 0
1 - Select a library member
2 - List all members
3 - List all books in the Library
4 - List borrowed books
0 - Exit
Select one of the above numbers (0-4): 0
*********************************
Thanks for using this program
*********************************