0% found this document useful (0 votes)
11 views2 pages

Task Oop 3

Uploaded by

Roaa Zakaria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Task Oop 3

Uploaded by

Roaa Zakaria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

You can’t work on this task if you don’t solve OOP task1 and task2 (Library system).

• Task3 Online Shopping System:

Imagine an online shopping system that incorporates the classes and features described. This system allows users to
browse products, add them to their cart, and place orders and payment. Here's an expanded description:

1. User Class:

• Properties: id (unique identifier make it auto increment), name, email,password, address.

• Methods: display_info() to showcase general information about a user, register_user() to register new
user, login_user() to login user,logout_user() to logout user from system.

get_user_by_id() to find user by their id,update_user() (Include a method to update user information (e.g., change
password, update address).

2. Customer Class (Inherits from User):

• Additional Properties: cart (a list of items) wishlist,paymentCard(card instance).

• Additional Methods: add_to_cart(item), remove_from_cart(item), view_cart().

3. Admin Class (Inherits from User):

• Additional Properties: permissionType (type of what can admin do like add , edit , delete, verifyPayment)
hint : maybe admin have two permission or all.

• Additional Methods: displayAllPermission(),addNewPermission(),deletePermission(),

VerifyPayment() {You should insure admin have permission to do action for every function }.

4. BankCard Class :

• Properties: card_id (unique identifier make it auto increment),type {visa,master,amazon….},totalBalance

(total money in the card).

5. Product Class:( can’t used to create objects)

• Properties: product_id (unique identifier make it auto increment), name, price, description.

• Methods: display_info() to show basic product information.

6. ElectronicProduct Class (Inherits from Product):

• Additional Properties: brand, warranty_period.

• Additional Methods: display_info() (overriding to include electronic-specific details).

7. ClothingProduct Class (Inherits from Product):

• Additional Properties: size, color,type.

• Additional Methods: display_info() (overriding to include clothing-specific details).

8. Payment Class:
• Properties: payment_id (unique identifier make it auto increment), order(instance if order class),
payment_method, status (e.g., pending, successful, failed), timestamp(date and time, hint: make struct
or any like it for date).

• Methods: process_payment() (for example ask user to input their card number then validate this
number and check if card have enough money make payment otherwise give error to user),
check_payment_status(), display_payment_details().

• All Payment if succeed become pending until admin verify the payment and make status successful,

9. Order Class:

• Properties: order_id (unique identifier make it auto increment), customer (linked to a Customer
instance), products (a list of Product instances), order_date, total_price.

• Methods: calculate_total_price():(use operator overloading to sum total price), display_order_details(),


order_discount()(if bank card type of the user is visa make 10% discount and if it’s amazon make 25%
discount otherwise make +15% addition to total price of order).

10. OnlineShoppingSystem Class:

• Properties: customers (a list of Customer instances), products (a list of Product instances), orders (a list
of Order instances).

• Methods: add_customer(customer), add_product(product), viewAllProductsInformations(),


place_order(customer, products),filter_product() (Include a method to search and filter products based
on name).

Notes :

• Each class should have parameter constructor and set,get for every attribute.

• You should read and write all data with files (text or other).

• For inputs data and define object use operator overloading >> and for output use << (if you work with cpp).

• Validate all data inputs by user and return error messages for it’s.

• User can’t do anything in the system before register or login after that you should store user who login to
verify authentication before any action maybe he do.

• Make your code clean as possible and separate every class to file.

• Introduce friend functions where necessary, allowing non-member functions to access private members of a
class.

• At main You Should print menu with number items to user to select action that he want to do (for every
functions in previous classes must have select item).

Prepared by Eng. Basel

You might also like