Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions