Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Polymorphism Assignment (Department Store Shopping Cart) Create an application that allows a user to buy (clothes, electronics, toys, household goods, groceries and liquor). The user

Polymorphism Assignment (Department Store Shopping Cart)

Create an application that allows a user to buy (clothes, electronics, toys, household goods, groceries and liquor). The user can add the items to their cart and when they check out, each item's cost is calculated, tax is applied based upon item category and the total purchase amount is displayed.

Requirements:

1.) Item abstract class

a.) Description

b.) Item Cost

c.) Item Cost with Taxes

d.) Tax rate

e.) Quantity

f.) Abstract methods for:

- Calculate Item Cost (calculate's cost - quantity * itemCost)

- Calculate Item Cost with Taxes (using tax rates appropriately)

- DisplayItemDetails (Displays category, description and total cost)

g.) Concrete classes that Inherit from Item for (clothes, electronics, toys, household goods, groceries and liquor)

- Clothes = 6% tax rate

- Electronics = 7% tax rate

- Household goods = 6% tax rate

- Groceries = 5% tax rate

- Liquor = 10% tax rate

h.) Shopping Cart Class:

- Array for shopping cart

- Methods:

> Add to cart

> Calculate transaction total

> Get Shopping cart

i.) Test/Demo class:

- Displays item categories to user

- Allows user to pick category and then add item to cart (Scanner class)

> Once user picks a category they can provide any description for the item as well as quantity and price they want. Tax rate is fixed.

- Displays the following:

>Each item description, the quantity and item cost

> For each category (# of items sold, tax rate and total cost with taxes)

> Total cost for all items in the shopping cart

-------------------------------------------------------

Screenshots (3 Screenshots show 1 Run of the demo application):

image text in transcribed

image text in transcribed

image text in transcribed

Show transcribed image text

Welcome to the shopping cart! Please select the category for your purchase (select the category number - enter 0 to checkout): 1. Clothes 2.Electronics 3.Household goods 4.Groceries 5.Liquor Enter a description of the clothing item Jeans Enter the price for Jeans 45.99 Enter the number of Jeans you want to purchase 2 Clothes item purchased. Item Name: Jeans Price before tax: $91.98 Cost with tax: $97.50

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

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions