1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Illusion [34]
3 years ago
6

LAB: Plant information (ArrayList) Given a base Plant class and a derived Flower class, complete main() to create an ArrayList c

alled myGarden. The ArrayList should be able to store objects that belong to the Plant class or the Flower class. Create a method called printArrayList), that uses the printinfo methods defined in the respective classes and prints each element in myGarden. The program should read plants or flowers from input (ending with -1), adding each Plant or Flower to the myGarden ArrayList, and output each element in myGarden using the printinfo method Ex. If the input is: plant Spirea 10 flower Hydrangea 30 false lilac flower Rose 6 false white plant Mint 4 -1 the output is: Plant Information: Plant name: Spirea Cost: 10 Plant Information: Plant name: Hydrengea Cost: 30 Annual: false Color of flowers: lilac Microsoft Edge Plant Information: Plant name: Hydrengea Cost: 30 Annual: false Color of flowers: lilac Plant Information: Plant name: Rose Cost: 6 Annual: false Color of flowers: white Plant Information: Plant name: Mint Cost: 4 LAB ACTIVITY 9.18.1: LAB: Plant information (ArrayList) 10/10 Current file: PlantArrayListExample.java Load default template... 1 import java.util.Scanner; 2 import java.util.ArrayList; 3 import java.util.StringTokenizer; 4 5 public class PlantArrayListExample { 6 7 // TODO: Define a PrintArrayList method that prints an ArrayList of plant (or flower) objects 8
Computers and Technology
1 answer:
sashaice [31]3 years ago
4 0

Answer:

LAB: Plant information (ArrayList) Given a base Plant class and a derived Flower class, complete main() to create an ArrayList called myGarden. The ArrayList should be able to store objects that belong to the Plant class or the Flower class. Create a method called printArrayList), that uses the printinfo methods defined in the respective classes and prints each element in

You might be interested in
Grooves and polished surfaces on desert pebbles are most likely caused by
Serga [27]
B. abrasion. Abrasion is pretty much friction on the rocks. Yardangs don't really apply to this situation and I have never heard of a deflated rock:P Hope that helps:) 
7 0
3 years ago
Which of the following is the last step in creating a budget?
sweet [91]
You answer to the question is C
3 0
3 years ago
Technician A says that a ratio is a comparison between two values. Technician B says that in a compression ratio, the main value
azamat
Both a and b it’s is the right choice
6 0
3 years ago
if you want to present slide to fellow student or co-workers, wich productivity software should you use to create them?
Reika [66]
Microsoft PowerPoint
6 0
3 years ago
To paste text with the same formatting as the document in which it is entered, select _____ from the Paste menu.
shusha [124]
Merge Formatting because you are merging the format of the document you copied from. So basically you are moving the format over.
3 0
3 years ago
Other questions:
  • How to tell if screen or screen protector is cracked?
    5·2 answers
  • Please answer questions 34, 36 &amp; 37. <br><br>No explanation required. ​
    8·1 answer
  • Which of the following is considered part of the process in the systems thinking example of a TPS?
    6·1 answer
  • Checker for integer string (Please answer in C++):
    8·1 answer
  • Does anyone know how to connect a nintendo switch to a laptop?
    10·2 answers
  • Searching for a particular record in a database is called “querying the data.”<br> True<br> False
    9·2 answers
  • My brainly isnt working it isnt showing and answers wats going on? wat do i do
    14·2 answers
  • How do you use switch board in the office​
    6·1 answer
  • SOMEONE HELP 60 POINTS!!!!! When creating business publications, these two factors must be determined before planning the layout
    8·2 answers
  • Value (related to the five 'v's' of big data) addresses the pursuit of a meaningful goal. true false
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!