Question: Language: Java 1. Create a Book class with the following attributes and methods: - int: price - String: title - Constructor, accessors, mutators, and toString.

Language: Java

1. Create a Book class with the following attributes and methods:

- int: price

- String: title

- Constructor, accessors, mutators, and toString.

2. Create a BookStore class as a driver with the following functionalities

- A text file named books.txt for storing the books.

- Each line contains information of one book with the following format:

- bookTitle : price

The program shows the following menu to the user:

1: add books

- Ask the user to enter the books. Once the user entered all books, write the books into the books.txt with the given format.

2: show books

- Read the book information from the books.txt file into an array of books and print the book information on the screen.

0: exit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!