Question
Develop a Book Search program in Java AND design and implement a linked list data structure in Java to keep track of the books. Input
Develop a Book Search program in Java AND design and implement a linked list data structure in Java to keep track of the books.
Input file: pj4Data.txt
Assumption:
? The number of records in pj4Data.txt is unknown.
? Your program will skip/reject dirty data lines. For example, if a line contains 2 fields, it is considered as a dirty data line and will be rejected/skipped by your program.
Each line in pj4Data.txt contains 3 fields, separated by commas:
ID, Title, Publish Year
Shown below is a sample data line: 38176,Java For Beginners,2011
You are tasked to develop a Book Search program in Java to provide three menu selections:
? Summary Report shows all books in alphabetical order by the title.
? Search by Publish Year allows the user to search books by a specific year.
? Exit terminates the program.
You are also required to design and implement a linked list data structure in Java to keep track of the books.
(You are not allowed to use any linked list related library class in Java.)
Shown below is an implementation of the Book class.
You can modify the Book class as you wish.
// The Book class has 3 attributes: ID, Title, Publish Year
public class Book implements java.io.Serializable
{
int ID; String title; int year;
public Book() { }
public Book(int i, String t, int y, String a) { ID = i; title = t; year = y; }
public int getID() { return ID; }
public String getTitle() { return title; }
public int getYear() { return year;}
public void setTitle(String t) { title = t; }
public void setYear(int y) { year = y; }
public String toString() { return ID + " " + title + " " + year + " " + author; }
} // Book
pj4Data.txt :
38176,Java For Beginners,2011 29181,Home Sweet Home,2010 11125,Becoming Super Programmer,2017 42019,Robert Fulton, Boy Craftsman,2017 28279,Sarah, Plain and Tall,2016 49819,C++ Programming,2011 12524,Developing Servlets,2009 35002,JavaScript Language,2010 23675,Java Data Structures,2011 76291,The Courage of Sarah Noble,2002 26199,Friend of the Pilgrims,1999
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started