Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are to create an application that will read data from a file and store it in a collection of objects. You will create

image text in transcribed

You are to create an application that will read data from a file and store it in a collection of objects. You will create a class called Bookstore which will maintain a list of Book objects (the second class you will create). Methods of Bookstore: load - takes a string representing a filename, opens the file, reads the data, splits it into components, trims any extra whitespace and converts the data where necessary, and adds Book objects to the list accordingly. Don't forget to close the file when done. add - takes the following parameters: title, subtitle, edition, authors (edition is always an integer, everything else is a string), creates a Book from it, and then adds that book to the list. remove - takes a title and edition, finds the first book in the list that matches the criteria, and removes it from the list, returning True. If it cannot find the book, it returns False (Hint: you can assume that you won't find the item - that is, set a local variable to False - then, if you find it, set that same variable to True. Regardless, at the end of the problem, you return the status, which will be False unless you found a match.) _str_ - returns a string which is a formatted list of books, looking like the following: Big Java Late Objects 2 Cay Horstmann

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

Did you cite the sources of the statistics?

Answered: 1 week ago