Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

java shopping cart package image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

image text in transcribedimage text in transcribedimage text in transcribed

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Support For Data Mining Applications Discovering Knowledge With Inductive Queries Lnai 2682

Authors: Rosa Meo ,Pier L. Lanzi ,Mika Klemettinen

2004th Edition

3540224793, 978-3540224792

More Books

Students also viewed these Databases questions

Question

The nature and importance of the global marketplace.

Answered: 1 week ago