Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA coding help! https://gyazo.com/e9688e1e75e5f431597e6ebca1d270cb Main: https://gyazo.com/71269414d99e18d79da619b1d05338e8 https://gyazo.com/d493299f94c2ef3ec8a42e0a1a76f8fa https://gyazo.com/bc22fb9caa8b10837d71116bcf7a3ebe https://gyazo.com/b4b40f2f0afc2c23de297287251aa5a0 https://gyazo.com/62a21c1a85953e5e712bf560ebf3d7a9 https://gyazo.com/4c8903074ea99358784ed45118e9008f price of groceryon-grocery items. Once you implement the changes, you can uncomment the lines

JAVA coding help!

image text in transcribed https://gyazo.com/e9688e1e75e5f431597e6ebca1d270cb

Main:

image text in transcribed https://gyazo.com/71269414d99e18d79da619b1d05338e8

image text in transcribed https://gyazo.com/d493299f94c2ef3ec8a42e0a1a76f8fa

image text in transcribed https://gyazo.com/bc22fb9caa8b10837d71116bcf7a3ebe

image text in transcribed https://gyazo.com/b4b40f2f0afc2c23de297287251aa5a0

image text in transcribed https://gyazo.com/62a21c1a85953e5e712bf560ebf3d7a9

image text in transcribed https://gyazo.com/4c8903074ea99358784ed45118e9008f

price of groceryon-grocery items. Once you implement the changes, you can uncomment the lines in Main and run, you should an output similar to: A virtual item cannot have a quantity more than 1 Pencil 10 $0.99 Notepad 3 $1.99 Apple 5 $0.49 2017-11-11 Mango 10 $1.25 2017-12-1 imported from Mexico Wonder Woman 1 $9.99 2000.OMB Total price of all items is $40.81 Total price of grocery items is $14.95 Total price of non grocery items is $25.860000000000003 1 Add an attribute price (double) to Item. Add a setter method. Note that since Item is the Base class of Groceryltem, ImportedGroceryltem, and Virtualltem, the attribute and the setter method are automatically inherited (how wonderful!) Modify the method toString to add the price to the result 2- 3- Next implement a method calculateTotal, also in item. This method returns the price quantity 4- In ShoppingCart, implement the method getTotal. This method returns the total price of all 5- Now, implement the method getGroceryTotal. This method returns the total price of grocery 6- Similarly, implement the method getNonGroceryTotal. This method returns the total price of of the item items in the cart items in the cart non-grocery items in the cart

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

Define Management by exception

Answered: 1 week ago

Question

Explain the importance of staffing in business organisations

Answered: 1 week ago

Question

What are the types of forms of communication ?

Answered: 1 week ago

Question

Explain the process of MBO

Answered: 1 week ago