Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How is this written in Java programming language? CSCI 3200 Assignment 4 100 points Due date: Thursday, Sept. 28 (before class) In this assignment, you

How is this written in Java programming language? image text in transcribed
image text in transcribed
CSCI 3200 Assignment 4 100 points Due date: Thursday, Sept. 28 (before class) In this assignment, you will write a program to simulate an inquiry system of a small library. The program should operate as follows: 1. Read the library catalog from an input data file. The data file should be named catalog.txt. There is one input line per book, and these lines have the following format: -book id> is a 5-digit positive integer (you may assume the leftmost digit is not a zero), is a string of at most 30 characters with no embedded blanks (you can use""in between words in a title), is a string of 10 digits, is a string of at most 10 characters, and is a character ('F' if the book is fiction; 'N' if it is a non- fiction book). You may assume the catalog has no more than 100 books (a small library). A sample catalog is shown at the end of the specification. Make sure to include exception handling code related to file input. 2. Read from standard input a customer's inquiry with a given book_id and output the complete information of the book. Your program should allow the customer to continue to inquiry about other books. When a zero input for -book id- is entered, it means the end of the customer's inquiry The output should include the book id, book_title, ISBN, author_last name, and "Fiction" or Non-Fiction" for category, printed on a single line. A sample output is shown at the end of the specification. 3. Exception handling: The following error is possible and should be handled by your program not found. You need to define a BookNotFoundException and handle it by writing an error message. This should be defined as a checked exception. It should include two constructors. One is the default constructor, and the other is one-parameter constructor and the parameter type is String. Program Structure: Your source code should be developed in three files: Book.java, BookDemo.java, and BookNotFoundException.java. Book,java will contain the class definition for a book according to the requirements specified below. BookDemo java will be the application program that runs the simulation of the inquiry. BookNotFoundException java will define the checked exception

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

How many rows were loaded for the Finished_Goods_Products query?

Answered: 1 week ago

Question

In which of the following environments can sound travel fastest?

Answered: 1 week ago

Question

Which type of energy does an object have when it is in motion?

Answered: 1 week ago

Question

The working principle of a washing machine is?

Answered: 1 week ago