Question: I want to create two methods: 1. Menu item 1. Ask the user for the id of the plant and how many shares to remove

I want to create two methods: 1. Menu item 1. Ask the user for the id of the plant and how many shares to remove // Do not let them remove more than exist in inventory // If the id does not exist, make certain to indicate this.

2. Menu item 2. ask for the plant id and totally delete that plant from the collection // If the id does not exist, make certain to indicate this.

Here is the collection information:

ArrayList plants = new ArrayList(); plants.add(new Plants("JAPMA", "Japanese Maple", 30, 60.25, 85.50)); plants.add(new Plants("DOG", "Dogwood", 20, 15.50, 32.50)); plants.add(new Plants("RED", "Redbud", 45, 21.00, 28.00)); plants.add(new Plants("RBUCK", "Red Buckeye", 24, 21.00, 33.00)); plants.add(new Plants("CRMY", "Crape Myrtle", 48, 19.00, 29.50)); plants.add(new Plants("TULIP", "Tulip Tree", 30, 23.00, 38.50)); plants.add(new Plants("FALSE", "Hinoki False Cypress", 40, 18.35, 29.50)); plants.add(new Plants("SERVICE", "Serviceberry", 30, 43.00, 58.50)); plants.add(new Plants("SMOKE", "Smoke Tree", 18, 34.00, 45.50)); return plants;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!