Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider an e-store with various types of items: books, flowers, gift cards, etc... and we like to be able to support the ability to handle

Consider an e-store with various types of items: books, flowers, gift cards, etc... and we like to be able to support the ability to handle a shopping cart that can contain various types of items.

For this question you are asked to create the following classes:

abstract class: “Item”
every item has a unique item_id (a positive integer, auto-incremented for each new item), a price (double, 0 or positive), and quantity (integer, 0 or positive), Title (String, cannot be empty).Every item can be “Display()”, an abstract method, and “Purchase()” (that is removed from the inventory).

concrete class: “Book”
a Book is-an item. It adds the attributes “author”, “title” and “year”.

concrete class: “GiftCard”
a GiftCard is-an item. It adds the attributes “label”, and “manufacturer”.

concrete class: “Shoe”
a Shoe is-an item. It adds the attributes “colour” (a String one of these colours: white, silver, red, beige, brown, blue, black, pink), and “size” (double).

Write an application that maintains a list of items entered from the user by means of an interactive menu.

The user can:

Add item to the inventory, entering its type (book or gift card, etc), and necessary attributes along with quantity.

Display all items.

Display only books sorted by author name.

Display only gifts sorted by label.

Display only shoes sorted by sizeDelete an item by item_id

Purchase an item by removing the purchased quantity from the inventory


You should:   Save items to a file, and loading them back, using object serialization.

You should: use a linked list to enable dynamic size for the e-store,  instead of array object .


Write all necessary classes and methods to ensure the responsibility driven assignment of classes in a pure object-oriented approach enforcing all business rules. Document all the rules and classes using Javadoc compatible documentation.

Step by Step Solution

3.49 Rating (152 Votes )

There are 3 Steps involved in it

Step: 1

Solution import javautilLinkedList abstract class Item private static int count 0 protected int itemID protected double price protected int quantity p... 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

Statistics For Business And Economics

Authors: Paul Newbold, William Carlson, Betty Thorne

8th Edition

0132745658, 978-0132745659

More Books

Students also viewed these Programming questions