Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have this code but it cant be running..it got error. The error like this : error: can't find main(String[]) method in class: Library Please

I have this code but it cant be running..it got error.

The error like this :

error: can't find main(String[]) method in class: Library 

Please help me solve this.. i need to submit my coding ASAP.

Please run it, and give me the correct coding

import java.util.ArrayList; import java.util.HashMap;

public class Library { private HashMap library; private ArrayList patrons;

public Library() { library = new HashMap(); patrons = new ArrayList(); } public void addBook(int ISBN, String title, String author, String publisher){ Book book = new Book(ISBN, title, author, publisher); library.put(ISBN, book); } public Book searchBook(int ISBN) { return library.get(ISBN); } public void displayLast10Books(int patronID) { Patron patron = patrons.get(patronID - 1); ArrayList books = patron.getBorrowedBooks(); int size = books.size(); int start = size - 10; if (start

class Book { private int ISBN; private String title; private String author; private String publisher; public Book(int ISBN, String title, String author, String publisher) { this.ISBN = ISBN; this.title = title; this.author = author; this.publisher = publisher; } public int getISBN() { return ISBN; } public String getTitle() { return title; } public String getAuthor() { return author; } public String getPublisher() { return publisher; } }

class Patron { private int ID; private String name; private String email; private ArrayList borrowedBooks; public Patron(int ID, String name, String email) { this.ID = ID; this.name = name; this.email = email; borrowedBooks = new ArrayList(); } public int getID() { return ID; } public String getName() { return name; } public String getEmail() { return email; } public ArrayList getBorrowedBooks() { return borrowedBooks; } public void setName(String name) { this.name = name; } public void setEmail(String email) { this.email = email; } public void borrowBook(Book book) { borrowedBooks.add(book); } }

image text in transcribed

image text in transcribed

COMMUNITY LIBRARY MANAGEMENT SYSTEM The Kuala Lumpur City Hall (DBKL) has established a community library in Chow Kit. As a software development company, your company has been rewarded with the project of establishing the library management system (LMS) for the community library. The LMS main functionalities for the LMS is to manage the books. Books in the community library are group into two categories of Fiction, Non Fiction. Those categories were then subdivided into genres as shown in Table 1. Each book title belong to one category and one genre. There are possibility of one book title to have more than one copies in the collection. For example, there are two copies of books entitled "One Thousands and One Nights". Therefore those two books must be uniquely identified. If one copy being borrowed, the other should be available to be borrowed by other patrons. Besides book, the LMS should also be able to manage patrons. This include registering patrons, updating their information and most importantly books borrowing and returning functionalities. Each patron may borrow at most of 3 books at any given times Implementing appropriate data structure to store and manage the books and patrons' information, you are required to develop a prototype using JAVA with the following functionalities: 1. Books 1.1 Book display - View all book titles available. 1.2 Add book - Add individual book copy. 1.3 Search book - Search books based on category, genre, title and availability. 1.4 Update books' information. 2. Patrons 2.1. Patron registration - registering a patron into the LMS. 2.2. Search patron - Search for patron based on name, ID, etc. 2.3. View all patrons with active book borrowed. 2.4. Display the last 10 books borrowed by a patron. 2.5. Update patrons' information. Program design documentation a. In this document/report, you need to describe and justify your selection of data structure implemented. You may implement different data structures for each component (i.e. Book and Patron). b. Visualize your chosen data structures for both Book and Patron with sample data. c. Provide the flowchart for the following operations: i. Add book ii. Search book iii. Display the last 10 books borrowed by a patron. iv. Update patrons' information d. Submit your report in PDF format with following naming convention: _CSC508_20224.pdf. (e.g., 2022587469_CSC508_20224.pdf) Complete JAVA program prototype a. The program prototype should be text- and menu-based prototype. Do not use GUI. b. Each functionality, for both Book and Patron should be defined as a method of their own. You may include other methods required for your program to run. c. Please include one helper method initialload( ) that will load 3 sample books and 2 sample patron when the program is executed. d. Submit your prototype as one java file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions

Question

b. Why were these values considered important?

Answered: 1 week ago