Task Oop 3
Task Oop 3
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:
• 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).
• Additional Properties: permissionType (type of what can admin do like add , edit , delete, verifyPayment)
hint : maybe admin have two permission or all.
VerifyPayment() {You should insure admin have permission to do action for every function }.
4. BankCard Class :
• Properties: product_id (unique identifier make it auto increment), name, price, description.
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.
• Properties: customers (a list of Customer instances), products (a list of Product instances), orders (a list
of Order instances).
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).