Question: Your application should include a Console Interface. Problem Statement: You are tasked with creating a console - based e - commerce system. The system should
Your application should include a Console Interface.
Problem Statement:
You are tasked with creating a consolebased ecommerce system. The system should allow customers to place orders for products, and administrators to manage products. The application will involve:
Abstract Classes to define the structure of products.
Interfaces for user roles eg customer and administrator
Error Handling to manage issues like invalid input or outofstock products.
Requirements:
Create an abstract class Product that defines a general structure for a product with common properties like Name, Price, and StockQuantity.
Create two concrete product types PhysicalProduct and DigitalProduct that inherit from the Product class.
Define an interface IUserRole that outlines a introductory behavior for different user roles eg printing the customer or the administrator's information
Implement two classes, Customer and Administrator, which implement the IUserRole interface.
Administrators should be able to create Physical or Digital Products, and update their information such as price, name, stock, etcCustomers should be able to see a list of products and acquire them, which in turn turn should decrease the stock.Both users should be able to see their information.
Include proper error handling to manage exceptions such as invalid input, insufficient stock, or null values.
Execution:
Your application should include a console menu, allowing a user to pick options as an administrator or customer. No need to utilizing a login system, a simple selection between Admin and User functions is enough.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
