Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A Java console program that allows you to record and display information about books in your personal home library. The data that is recorded should

A Java console program that allows you to record and display information about books in your personal home library. The data that is recorded should be available across user sessions. Make use of files and serialization to accomplish this task. Your application should contain a Book class, a Library class (for adding, displaying, and saving books) and any other classes needed to obtain the functionality below.

The main menu of the program should contain the following details:

## Welcome to the Home Library System ##

Please select one of the following options:

1. Add a new book

2. Display all books

3. Exit

Whenoption1is selected, the program will ask for the following details:

Title of the book

Author of the book

Year of publication

ISBN number

For the purpose of this task, the ISBN number is a unique 10 digit number consisting only of individual digits in the range 0-9.If you hold two copies of the same book they will have the same ISBN number but will otherwise be distinct. Creating anISBNFormatErrorclass to respond to formatting errors of this type.

Once the user correctly enters the information above and presses "return", the book should be added to an appropriate data structure. If the book was successfully created and added, print a suitable message and re-show the main menu. If the book was not successfully created or added, print a suitable message and re-show the main menu.

Whenoption2is selected display all books in the library based on the alphabetical order of the title. If there are two copies of the same book, the one with the lowest publication year should be displayed first. The display order should be based on title first, then author, year, then date of publication, as follows:

Title: A day in the country

Author: Anne Preston

Year: 2001

ISBN:7488796045

Title: Last light

Author: Alex Scarrow

Year: 2007

ISBN:991145598

Title: Nineteen eighty four

Author: George Orwell

Year: 1984

ISBN:1991145592

Title: Nineteen eighty four

Author: George Orwell

Year: 1986

ISBN: 2991145592

Title: Nineteen eighty four

Author: Mary Owen

Year: 1986

ISBN:1676957444

When3is selected, the program will exit. Note that before the program terminates, you should save all information about the book collection in the home library to file. When the program is relaunched, this information should be reloaded into the program.

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

Transport Operations

Authors: Allen Stuart

2nd Edition

978-0470115398, 0470115394

Students also viewed these Programming questions

Question

What were the causes of the Industrial Revolution in England ?

Answered: 1 week ago

Question

QUESTION:- Hypertension- drugs, normal values?

Answered: 1 week ago