java shopping cart package
Java Class Lineltem com assignment2 d quantity: int FLineItem/Product,int) FLineItem Lineltem) calculateShipping Cost()int getProduct():Product getQuantty() int getPrice()int otoString/String -product 0..1 Java Class Product com assignment2 name: String price int productDiscount int Product(String, int) getName() String getPrice():int setProductDiscountint) void toString-String calculate Shipping Cost().int > NonprofitCustomer com.assignment2 Nonprofit Customer(Stringlong) calculateDiscount()int -cred card 0..1 -customer 0..1 -line tems 10. *productMap /0.. > Physical Product com assignmenta weight int of Physical Product/String, int,int) calculate Shipping Cost()int
Shopping Cart com assignment2 Shopping Cart() addLinettem Linetem void gettinetems():ListeLinettem getTotalCostint toString(): String > BusinessCustomer com assignment2 Business Customer(String,long, BusinessSize) calculateDiscount().int toString String Business Size com assignmenta SMALL Business Size VVEDUM: Business Size LARGE BusinessSize BusinessSize) > Order com assignment Order(Customer Shopping Cart Payment) getCart() Shopping Cart toString() String payment 0.1 0.3 , return Optionl new Order(this, cart, p)); NonprofitCustomer Extends Customer For calculateDiscount, return 15 Customer Refer to diagram For the checkout method, call mkPayment method against the creditCard instance, Then return the following payment.map(p -> new Order(this, cart, p)); NonprofitCustomer Extends Customer For calculateDiscount, return 15 BusinessCustomer enum BusinessSize {SMALL, MEDIUM, LARGE} calculate Discount: use switch case to return 5 if size is small 10 if size is medium 20 if size is large Otherwise throw an AssertionError with a message indicating that the size is unknown Shopping Card Refer to diagram -product Java Class>> Lineltem com assignment2 quantity: int FLinetem(Product,int) Linetem(Lineltem) calculate Shipping Cost():int getProduct():Product getQuantity()int getPrice()int toString():String > Product com assignment2 = name: String price: int - productDiscount: int . Product(String, int) getName():String getPrice()int 52 setProductDiscount(int):void toStringo:String calculate Shipping Cost():int > Digital Product com assignment2 Digital Product(String,int) calculateShipping Cost(int 0..1 > Physical Product com.assignment2 weight: int Physica Product(String, int int) calculateShipping Cost():int BusinessCustomer com.assignment2 Cred mkP toStr > Shopping Cart com.assignment Shopping Carto addLinetem(LineItem:void getLineItems():List getTotalCost()int toString(): String Business Customer(String, long,BusinessSize) calculateDiscount();int toString String Business Size com assignment2 SMALL Business Size MEDIUM: Business Size LARGE: Business Size : of Business Size > Order com.assignment2 Order(Customer Shopping Cart Payment) getCart():Shopping Cart toString:String -product > Product com assignment2 name: String price: int - productDiscount: int Product(String,int) getName(): String getPrice():int setProductDiscount(int):void toString():String calculate Shipping Cost(); int > DigitalProduct com assignment2 of Digital Product(String, int) calculateShipping Cost().int toString():String 4 -customer 0..1 > NonprofitCustomer com assignment2 NonproftCustomer(String,long) calculateDiscount:int 0..1 -credit card 0.1 *productiap 0.: > Physical Product com.assignment2 - weight int Physical Product(String.int,int) calculate Shipping Cost:int > BusinessCustomer com.assignment2 Business Customer(String,long, BusinessSize) calculate Discount():int toString:String > Creditcard com.assignment2 cardNumber: long Credit Card(long) mkPayment(int):Optional Payment toString):String > Catalogue com.assignment2 SHIPPING_RATE: int Catalogue) getProduct/String):Product -credit Card 0..1 Size 10..1 -cart Business Size com assignment2 SMALL Business Size MEDIUM: Business Size LARGE: BusinessSize of BusinessSize > Order com assignment2 Order(Customer, Shopping Cart Payment) getCart():Shopping Cart toString:String calculate calculateShipping Costc).int getProduct():Product getQuantity() int getPrice():int toString():String getName():String getPrice()int setProductDiscount(int):void toString(): String calculate Shipping Cost():int calculateDiscount():int checkout(Shopping Cart):Optional Order> toString:String -Credit Card -customer 0..1 0..1 -linetems0... productMapo . > Physical Product com assignment2 weight int of PhysicalProduct(String, int,int) calculate ShippingCost().int of cardNun "Creditca mkPaym toString Java Class>> Shopping Cart com.assignment2 Shopping Carto addLinetem(Lineltem):void getLineItems():List getTotalCost()int toString(String > BusinessCustomer com.assignment2 Business Customer(String long, BusinessSize) calculateDiscount().int toString():String Java Class>> Catalogue com.assignment2 S SHIPPING RATE: int Catalogue() getProduct/String):Product -credit Card 0..1 Size 10.1 -cart 09 > Business Size com assignment2 SMALL: Business Size MEDIUM: Business Size SF LARGE: Business Size BusinessSize > Order com assignment2 Order(Customer, Shopping Cart Payment) getCart():ShoppingCart toStringO:String payment 0..1 > Payment com.assignment2 transactionid: UUD value:int of Payment Credit Card, int, UUID) toString():String Java Class Lineltem com assignment2 d quantity: int FLineItem/Product,int) FLineItem Lineltem) calculateShipping Cost()int getProduct():Product getQuantty() int getPrice()int otoString/String -product 0..1 Java Class Product com assignment2 name: String price int productDiscount int Product(String, int) getName() String getPrice():int setProductDiscountint) void toString-String calculate Shipping Cost().int > NonprofitCustomer com.assignment2 Nonprofit Customer(Stringlong) calculateDiscount()int -cred card 0..1 -customer 0..1 -line tems 10. *productMap /0.. > Physical Product com assignmenta weight int of Physical Product/String, int,int) calculate Shipping Cost()int Shopping Cart com assignment2 Shopping Cart() addLinettem Linetem void gettinetems():ListeLinettem getTotalCostint toString(): String > BusinessCustomer com assignment2 Business Customer(String,long, BusinessSize) calculateDiscount().int toString String Business Size com assignmenta SMALL Business Size VVEDUM: Business Size LARGE BusinessSize BusinessSize) > Order com assignment Order(Customer Shopping Cart Payment) getCart() Shopping Cart toString() String payment 0.1 0.3 , return Optionl new Order(this, cart, p)); NonprofitCustomer Extends Customer For calculateDiscount, return 15 Customer Refer to diagram For the checkout method, call mkPayment method against the creditCard instance, Then return the following payment.map(p -> new Order(this, cart, p)); NonprofitCustomer Extends Customer For calculateDiscount, return 15 BusinessCustomer enum BusinessSize {SMALL, MEDIUM, LARGE} calculate Discount: use switch case to return 5 if size is small 10 if size is medium 20 if size is large Otherwise throw an AssertionError with a message indicating that the size is unknown Shopping Card Refer to diagram -product Java Class>> Lineltem com assignment2 quantity: int FLinetem(Product,int) Linetem(Lineltem) calculate Shipping Cost():int getProduct():Product getQuantity()int getPrice()int toString():String > Product com assignment2 = name: String price: int - productDiscount: int . Product(String, int) getName():String getPrice()int 52 setProductDiscount(int):void toStringo:String calculate Shipping Cost():int > Digital Product com assignment2 Digital Product(String,int) calculateShipping Cost(int 0..1 > Physical Product com.assignment2 weight: int Physica Product(String, int int) calculateShipping Cost():int BusinessCustomer com.assignment2 Cred mkP toStr > Shopping Cart com.assignment Shopping Carto addLinetem(LineItem:void getLineItems():List getTotalCost()int toString(): String Business Customer(String, long,BusinessSize) calculateDiscount();int toString String Business Size com assignment2 SMALL Business Size MEDIUM: Business Size LARGE: Business Size : of Business Size > Order com.assignment2 Order(Customer Shopping Cart Payment) getCart():Shopping Cart toString:String -product > Product com assignment2 name: String price: int - productDiscount: int Product(String,int) getName(): String getPrice():int setProductDiscount(int):void toString():String calculate Shipping Cost(); int > DigitalProduct com assignment2 of Digital Product(String, int) calculateShipping Cost().int toString():String 4 -customer 0..1 > NonprofitCustomer com assignment2 NonproftCustomer(String,long) calculateDiscount:int 0..1 -credit card 0.1 *productiap 0.: > Physical Product com.assignment2 - weight int Physical Product(String.int,int) calculate Shipping Cost:int > BusinessCustomer com.assignment2 Business Customer(String,long, BusinessSize) calculate Discount():int toString:String > Creditcard com.assignment2 cardNumber: long Credit Card(long) mkPayment(int):Optional Payment toString):String > Catalogue com.assignment2 SHIPPING_RATE: int Catalogue) getProduct/String):Product -credit Card 0..1 Size 10..1 -cart Business Size com assignment2 SMALL Business Size MEDIUM: Business Size LARGE: BusinessSize of BusinessSize > Order com assignment2 Order(Customer, Shopping Cart Payment) getCart():Shopping Cart toString:String calculate calculateShipping Costc).int getProduct():Product getQuantity() int getPrice():int toString():String getName():String getPrice()int setProductDiscount(int):void toString(): String calculate Shipping Cost():int calculateDiscount():int checkout(Shopping Cart):Optional Order> toString:String -Credit Card -customer 0..1 0..1 -linetems0... productMapo . > Physical Product com assignment2 weight int of PhysicalProduct(String, int,int) calculate ShippingCost().int of cardNun "Creditca mkPaym toString Java Class>> Shopping Cart com.assignment2 Shopping Carto addLinetem(Lineltem):void getLineItems():List getTotalCost()int toString(String > BusinessCustomer com.assignment2 Business Customer(String long, BusinessSize) calculateDiscount().int toString():String Java Class>> Catalogue com.assignment2 S SHIPPING RATE: int Catalogue() getProduct/String):Product -credit Card 0..1 Size 10.1 -cart 09 > Business Size com assignment2 SMALL: Business Size MEDIUM: Business Size SF LARGE: Business Size BusinessSize > Order com assignment2 Order(Customer, Shopping Cart Payment) getCart():ShoppingCart toStringO:String payment 0..1 > Payment com.assignment2 transactionid: UUD value:int of Payment Credit Card, int, UUID) toString():String