Project 1
ECOMMERCE PROJECT
Ecommerce project like as pecific plartform from user ,admi to access products and modify
AFFECTING FACTORS:
- Store
- Cart
- Order
- Catalogue
- Categery
PARTICIPANTS:
- Customer
- Seller
- Admin
(Every file code is presented here individually)
1.store.javafile
package Ecommerce;
import java.util.Scanner;
public class Store{
public static void main (String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println();("welcome to the store \nPlease login as 1.Customer 2.Seller 3.Admin");
int Chooise=sc.nextint();
String typeOfuser;
if (Chooise==1) {
typeOfuser="Customer";
Customer cur=new Customer();
System.out.println("plz login by user credentials\nUserName");
sc.nextline();
String UserName =sc.nextline();
cur.setUserName(UserName);
System.out.print("password");
String password=sc. nextline();
cur.setpassword(password);
if (cur.login()) {
System.out.println("login success");
System.out.println("1.view products 2.view cart 3.contactus 4.any suggestaions 5.exit");
int Ch1=sc.nextint();
if (Ch1==1) {
Catalogue ct=new Catalogue();
Prduct listOfPro[]=ct.getlistOfproducts();
for (int i=0;i
2.user.javafile
package Ecommerce;
abstract class User{
String UserName;
String password;
String loginStatus;
public String getUserName(){
return this.UserName;
}
public void setUserName(String UserName){
this. UserName=UserName ;
}
public String getpassword(){
return this.password;
}
public void setpassword(String password ){
this. password=password ;
}
public String getloginStatus(){
return this.loginStatus;
}
public void setloginStatus(String loginStatus){
this. loginStatus=loginStatus ;
}
abstract boolean login();
}
3.product.javafile
package Ecommerce
public class Product{
String ProductId;
String ProductName;
String ProductCost;
public String getProductId(){
return this.ProductId;
}
public void setProductId(String ProductId){
this.ProductId = ProductId;
}
public String getProductName(){
return this.ProductName;
}
public void setProductName(String ProductName ){
this.ProductName = ProductName;
}
public String get ProductCost(){
return this. ProductCost;
}
public void setProductCost(String ProductCost ){
this.ProductCost=ProductCost ;
}
}
4.customer.javafile
package Ecommerce;
public class Customer extends User{
Cart cart ;
public Cart getcart(){
return this.cart;
}
public void setCart(Cart cart ){
this.cart =cart ;
}
public boolean login(){
return true;
}
}
5.categery.javafile
package Ecommerce;
public class Categery{
}
6.cart.javafile
package Ecommerce;
public class Cart{
int CartId;
Product listOfproducts[];
public int getCartId(){
return CartId;
}
public void set(int CartId ){
this. CartId =CartId ;
}
public Product[] getlistOfproducts(){
return listOfproducts;
}
public void setlistOfproducts(Product[] listOfproducts ){
this. listOfproducts=listOfproducts ;
}
}
7.seller.javafile
package Ecommerce;
public class Seller{
}
8.catalogue.javafile
package Ecommerse;
public class Catalogue{
Product listOfproducts[];
public Product[] getlistOfproducts(){
Product p1=new Product();
p1.setProductId("1");
p1.setProductName("SHIRT");
p1.setProductCost("1000");
Product p2=new Product();
p2.setProductId("2");
p2.setProductName("SHIRT- v");
p2.setProductCost("2000");
listOfproducts=new Product[2];
listOfproducts[0]=p1;
listOfproducts[1]=p2;
return this.listOfproducts;
}
public static void main (String[] args) {
this.listOfproducts=listOfproducts;
}
}
9.admin.javafile
package Ecommerce;
public class Admin{
}