Challenge

Project 1

Project 1:
Create an e-commerce console project with the following specifications-
● That e-commerce should have these classes:
Administration, Store, Cart, Customer, Product, Seller, Catalog, User
● Admin class will check whether the user is an admin or a normal user if it is an admin he/she can modify the catalog.
● User class will check all the user authentication and will check the user Id and Password for all users.
● Cart will be taking care of all the cart items and will be having the option of checkout as well.
● Catalog is responsible for all the catalog activities.
● In the Store class-
○ Create an order object and assign this user to the order with an order id at the appropriate place.
○ Complete the logical store functionalities for the seller and administrator.
○ Make your code modular- divide it into many different small methods.
● In all the remaining classes-
○ Add default and parameterized constructors.
A. Add some dummy product data in your code with categories for each product added. Add subcategories to relevant categories. Now, Ask the customer to view products based on categories and display those products based on categories in the e-commerce store to the Customer if yes.
product1.setProductId("1");
product1.setProductName("Product 1");
product1.setCost("100");
Product product2 = new Product();
product2.setProductId("2");
product2.setProductName("Product 2");
product2.setCost("200");
B. The seller should be able to add products to different categories as well.
System.out.println("Do you want to add any product to the cart? Y/N");
sc.nextLine();
String addToCart = sc.nextLine();
if(addToCart.equals("Y")) {
System.out.println("Input the product id of the product which you want to add to cart");
String productId = sc.nextLine();
Product [] cartProducts = new Product[1];
for(int i=0; i<allProducts.length; i++) {
if(allProducts[i].getProductId().equals(productId));
cartProducts[0]=allProducts[i];
}
Cart cart = new Cart();
cart.setCartId("1");
cart.setListOfProducts(cartProducts);
// System.out.println(cartProducts[0].getProductName());
current.setCart(cart);
System.out.println("The Product is Successfullly added to the cart");
}
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.