Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 1 Lncs 8055

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013 Edition

3642402844, 978-3642402845

More Books

Students also viewed these Databases questions