Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Students also viewed these Databases questions

Question

2. Do you find change a. invigorating? b. stressful? _______

Answered: 1 week ago

Question

10. Are you a. a leader? b. a follower? _______

Answered: 1 week ago