Question: Using Java create the following classes below. You need to create four classes for a good rate, the classes are: Date, Book, BookStore, and Main(or

Using Java create the following classes below.

You need to create four classes for a good rate, the classes are: Date, Book, BookStore, and Main(or tester)

Date Create a class called Date, with private instance variables, accessors, mutators, and constructor parameters for the following data: year, month, day (all ints). It also has a method called getDate() which returns a String in the format of yyyy-mm-dd.

Book Create another class called Book, with private instance variables, accessors, mutators, and constructor parameters for the following data: title (a String) and datePublished (a Date). It also has a second constructor, which takes the title (String), year, month, and day (ints) as parameters.

BookStore Create a class called BookStore with an ArrayList of five ArrayList Book references; use both Book constructors when populating the ArrayList. Also create an Array of the same five Book references.

Create a method called displayBooks which displays the title and getDate() data for all the books in the ArrayList (use an iterator) and in the Array (use a for-each loop).

And Obviously a Main class(tester).

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!