Question
JAVA i need write java program Object Classes: designing Shopping Cart 1.Shopping Cart , build a checkout system for a shop which sells items (i.e.,
JAVA
i need write java program
Object Classes: designing Shopping Cart
1.Shopping Cart , build a checkout system for a shop which sells items (i.e., products say Bread, Milk, and Bananas). A shopping cart that can have multiples. Costs of the products are : Bread - $1, Milk - $0.60 and Banana - $0.40. A system should displays the order total.
2.The heart of a shopping cart can be represented in three classes: a cart class an order class, and an item class. Item objects are added to an array stored within the cart object.
3.Think first what are the nouns in the specification? (ex: Item) These are likely your Objects or possibly key data in an object
4.Which responsibilities belong to which nouns? These are likely to become their What are the relationships between nouns (Objects)? Draw it out that will help you visualize how they are interconnected
interace -oProductinterface o +double computeSalePriced + double getRegularPricep o+void setRegularPrice(double regularPrice) impleents interTace Product intertace Bookinterface Electronicsintertace -double regularPrice +Sinng gettianufacturer) +String getPublishet vold setPublishenString publisherj +Product(double regularPrice + double computeSalePriceQ o+int getfearPublisheco +void setYearP ublished(int?arPublished) o+double getRegula Price) ?+void setRegularPrice(double regularPrice) implements -String manufacturer Electronicsidouble regularPrice, String manufacturer) o 3tring getManufacturer0 o tvoid setklanutacturerSbing manufacturer) Book Sting publisher -int year Published Bookdoule regularPrice, Sring publisher, ini rearPublishec) o double computealePrice0 O Sbing getPublisher MP3Player vold setPublisher(Sting publisher) int geYearPublishedo int size -String color ?-void serre arPublished(int yearPublished TVidouble regularPfice, String manufacturer, int seMP3Playe double regularPrice, String manufacturer, String colorn o+double computesalePrice0 o+double computesalePrice0 +String getColor0 o void setColor String color) Cartoon ChildrenBook Main 4-String characterName -int age +Maino ?+Cartoon[double regularFnce, string publisher, int yearPublished, string characterName) ChildrenBookidouble regularPrice, String publisher, int yearPublish double computeSalePriceo double computeSalePricel0Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started