9:12 14. Make a class called Bookstore that has the following: a. ArrayList inventory a list of all the books in the store's inventory b. Constructor that initializes inventory //inventory's value should be a reference to a new ArrayList object c. A method public void 384 addBook (Book b) that will add a Book to the store's inventory. d. A method public int numBooks () that returns the number of Books in inventory. e. A method public Book getBook (int index) that returns the book at index in inventory. i. This method should return null if the supplied index is less than 0 or greater than or equal to the number of books in the inventory. f. Complete the method public double bookstoreValue (Bookstore store) in ArrayListProbs that returns the total value (prices) of all the books in the Bookstore's inventory. 15. In the Runner class there is a Bookstore <>

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

how would you do this? this is a non graded practice lab

9:12
14. Make a class called Bookstore that has the
following:
a. ArrayList<Book> inventory
a list of all the books in the store's
inventory
b. Constructor that initializes
inventory
//inventory's value should
be a reference to a new
ArrayList<Book> object
c. A method public void
384
addBook (Book b) that will add a
Book to the store's inventory.
d. A method public int
numBooks () that returns the
number of Books in inventory.
e. A method public Book
getBook (int index) that returns
the book at index in inventory.
i. This method should return
null if the supplied index
is less than 0 or greater than
or equal to the number of
books in the inventory.
f. Complete the method public
double
bookstoreValue (Bookstore
store) in ArrayListProbs that
returns the total value (prices) of all
the books in the Bookstore's
inventory.
15. In the Runner class there is a Bookstore
<>
Transcribed Image Text:9:12 14. Make a class called Bookstore that has the following: a. ArrayList<Book> inventory a list of all the books in the store's inventory b. Constructor that initializes inventory //inventory's value should be a reference to a new ArrayList<Book> object c. A method public void 384 addBook (Book b) that will add a Book to the store's inventory. d. A method public int numBooks () that returns the number of Books in inventory. e. A method public Book getBook (int index) that returns the book at index in inventory. i. This method should return null if the supplied index is less than 0 or greater than or equal to the number of books in the inventory. f. Complete the method public double bookstoreValue (Bookstore store) in ArrayListProbs that returns the total value (prices) of all the books in the Bookstore's inventory. 15. In the Runner class there is a Bookstore <>
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education