Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with the TODO list. I having trouble understanding what I should be doing for this section of the program. It would be

image text in transcribed
image text in transcribed
I need help with the TODO list. I having trouble understanding what I should be doing for this section of the program. It would be very grateful. public void testAdd() //Create grocery objects and shopping list instance Grocery iteml = new Grocery ("Harry Potter", "book", 3, 15.5f, 2); Grocery item2 = new Grocery (iteml); item2. setQuantity (3); ShoppingListArrayList instance = new ShoppingListArrayList(): // TODO test the add method for the case of adding a new item (iteml) into Hot instance // Be sure that // 1) size is increased by 1 // 2) the first item in the list 15 17 the same as in the reference variable, item // TODO test the "combine" feature of the add method W for the case of adding an existing entry, the item2 1/ into the shopping list instance created in previous W code block. The item2 has the same entry name as the item. 17 Be sure that 11) size is not changed 2) quantities are 1 properly changed in the first item in the list. 1/ Test adding a null entry reference to the apping list instance.add(null); assert True (1 - instance.size()); I need help with the TODO list. I having trouble understanding what I should be doing for this section of the program. It would be very grateful. public void testAdd() //Create grocery objects and shopping list instance Grocery iteml = new Grocery ("Harry Potter", "book", 3, 15.5f, 2); Grocery item2 = new Grocery (iteml); item2. setQuantity (3); ShoppingListArrayList instance = new ShoppingListArrayList(): // TODO test the add method for the case of adding a new item (iteml) into Hot instance // Be sure that // 1) size is increased by 1 // 2) the first item in the list 15 17 the same as in the reference variable, item // TODO test the "combine" feature of the add method W for the case of adding an existing entry, the item2 1/ into the shopping list instance created in previous W code block. The item2 has the same entry name as the item. 17 Be sure that 11) size is not changed 2) quantities are 1 properly changed in the first item in the list. 1/ Test adding a null entry reference to the apping list instance.add(null); assert True (1 - instance.size())

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

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

1.The difference between climate and weather?

Answered: 1 week ago

Question

1. What is Fog ?

Answered: 1 week ago

Question

How water vapour forms ?

Answered: 1 week ago

Question

What is Entrepreneur?

Answered: 1 week ago

Question

Which period is known as the chalolithic age ?

Answered: 1 week ago

Question

4. What advice would you give to Carol Sullivan-Diaz?

Answered: 1 week ago