Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment No. 1 Shopping Mall In this project, you will be implementing a simple shopping mall in C++. The mall will provide a soothing shopping

Assignment No. 1

Shopping Mall

In this project, you will be implementing a simple shopping mall in C++. The mall will provide a soothing shopping experience for your customers.

Here's a brief description of each class:

Mall:

The mall itself. The mall performs the creation of a set of different stores, such as a book store, a shoe store, an electronic games store, etc. The mall greets an arriving customer and allows the customer to shop at the mall. Some of the things a customer can do at the mall are:

1-Get a list of available stores

2-Get a shopping cart

3-Enter a store

4-Get of list of items available for sale at the store

5-Add items to the shopping cart

6-Proceed to checkout and purchase the items

Notable Attributes:

1-name - the name of the mall

2-stores - a collection of stores of different types

3-customers - the customers currently in the mall

Possible Methods:

1-void enter(Customer c) - customer c enters the mall

2void exit(Customer c) - customer c exits the mall

3-ShoppingCart getShoppingCart - returns an empty shopping cart

4-Enumeration customers() - returns an enumeration of the customers in the mall

5-void checkout(shoppingCart cart) - checkout and purchase the items in the shopping cart

Store:

Abstract superclass for a store

1-Notable Attributes:

2-name - the name of the store

3-storeId - unique ID for the store

4-items - items available for sale in the store

5-customers - the customers currently in the store

Possible Methods:

1-abstract void enter(Customer c) - customer c enters the store

2-abstract void exit(Customer c) - customer c exits the store

3-Enumeration customers() - returns an enumeration of the customers in the store

4-Enumeration items() - returns an enumeration of the items available for sale in the store

5-abstract void addToCart(shopingCart, item) - add an item to the shopping cart

6-abstract void removeFromCart(shopingCart, item) - remove an item from the shopping cart

BookStore:

A possible subclass of Store

ShoeStore

A possible subclass of Store

GameStore

A possible subclass of Store

Item

1-An item for sale in a store

Notable Attributes:

1-itemName - the name of the item

2-itemId - unique ID for the item

3-storeId - the ID of the store from which the item came

4-price - the price of the item

Customer:

1-A customer!

Notable Attributes:

1-name - the name of the customer

2-shoppingCart - the shopping cart being used by the customer

3-store - the store the customer is currently in

ShoppingCart:

1-A shopping cart for the customer

Notable Attributes:

1-items - items currently in the shopping cart

Possible Methods:

1-Enumeration items() - returns an enumeration of the items currently in the cart

Note that required accessors and mutators are not listed in the above for the sake of brevity.

Project Requirements

a. Draw a complete class diagram describing all classes in the system, as well as the static relationships between these classes. Use a single diagram to illustrate your class relationships.

b. Use the above framework to write a working version of the shopping mall.

Your project must have at least one customer, three stores and five items for sale at each store. Try to make the program as interactive as possible.

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

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

3 The distinction between microeconomics and macroeconomics.

Answered: 1 week ago

Question

2 The role of economic theory in economics.

Answered: 1 week ago