You are on page 1of 5

19 MAY 2021

Cs 304

Object Oriented Programming:

Student ID::

MC200201993

Student Name::

Bushra Saleem

Submitted By::

Sir Shafiq-ur-Rehman
Problem Statement:

Due to Ramadan, your nearby community wants to launch an “Online Grocery Store” so that,
people can purchase groceries from home and able to maintain social distance. This precaution
will allow reducing the movement of people in Ramadan and minimize the spread of disease
COVID-19. The XYZ store will offer various products. The user will be shown a list of products,
which can be selected or deselected from the provided list. The user will need to get registered
to buy Products. At the end of shopping, the customer can double-check all the Products added
into his Cart and verify the total amount before payment. The Store Administrator will manage
Products and assign orders to Delivery Boys.
Draw an Object Model (Class Diagram) for the given scenario showing main objects, their
attributes, functions and relationships.

The tasks you have to do are:


1. Extract the main objects (entities) of above system.
2. Find the necessary attributes and functions that need to be associated with each object.
3. Identify the relationships among identified objects.
4. Construct a final comprehensive Class diagram showing all objects and their relationships along with
their attributes and functions.

Objectives:

The objective of this assignment is:


o To give you the idea of practical implementation of the OOP concepts like
abstraction, encapsulation, inheritance, association, generalization, specialization,
and UML class construction.

Solution:
Q1:Extract the Main objects of above system?

Answer: 1::User Name

2:Products

3:Payment

4:Admin

5:Cash on delivery
6:Order

7:Order

8:Order details

9:Cart

10:category

Q2: 2. Find the necessary attributes and functions that need to be associated with each object?

Answer:

User

Attributes: username, password

Functions: login ID

Customer

Attributes : Email ,Phone number, address, History of products purchased

Functions: Customer ID

Admin

Attributes: email, Phone Number , Address

Product:

Attributes: Product ID, Product Name, Product description , price ,Exp date, mfg date, quantity

Functions: add product, update product, display product, delete product, get product details

Category:

Attributes: Category ID, category Name, Category description

Functions: add category, delete category, update category, display category

Order details

Attributes; Order ID, product ID, product Name, quantity, total cost, discount

Functions: calculate price

Cart:
Attributes: cart ID, product ID, quantity, date added

Functions: add cart items, update quantity, view cart details

Q3: Identify the relationships among identified objects.

Answer:1 ::Association

2::inheritance

3::Aggregation

4::Composition

4. Construct a final comprehensive Class diagram showing all objects and their relationships along
with their attributes and functions

UML diagram::

You might also like