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
Ann wants to save her presentation so she can work on it later. Which device on her computer can store this data long term?
RUDIKE [14]
I would say that the best option would be a multimedia card.
4 0
3 years ago
Without using any additional variables, and without changing the values of ndays or the elements of the parkingTickets array, wr
dusya [7]

Answer:

Explanation:

mostTickets=0;

for (k=0; k< ndays; k++){

if (parkingTickets[k]>mostTickets) mostTickets=parkingTickets[k];

}

7 0
3 years ago
Jeff has created a table to calculate the cost of raw materials that he purchases monthly. Cell A2 shows the fixed cost of the r
Luda [366]
=A2*D2
The above formula will allow calculation  of monthly cost of the first raw material.This is done by Multiplying the contents of cell A2 (Column A, Row 2) and cell D2 (Column D, Row 2). Here Cell A2 contains cost of the first raw material and Cell D2 contains number of units of the raw material produced  each month. After finding the monthly cost of the first raw material in this way, the monthly cost of other raw materials can simply be calculated by dragging down the formula to apply to the rows below.
3 0
3 years ago
Read 2 more answers
What would happen without satellites???
laila [671]

Answer: without satellites there would be no way for the world to communicate

Explanation:

4 0
3 years ago
Read 2 more answers
Identify the commands for the following list operations.
Bumek [7]

Answer:

D

Explanation:

the answer is D because it does exactly what the problem says.

3 0
2 years ago
Other questions:
  • How do you open Microsoft Excel 2013 with Windows 8?
    13·1 answer
  • Most of the pollution in the ocean comes from:
    11·1 answer
  • When selecting current page from the print range, on the print dialong box it will print
    5·1 answer
  • The most widely used presentation software program is Microsoft PowerPoint. You can produce a professional and memorable present
    5·1 answer
  • ____ is typically used with lans that have a star topology and can be used in conjunction with twisted-pair, coaxial, or fiber-o
    12·1 answer
  • The voluntary linkage of computer networks around the world is called the ______.
    7·1 answer
  • Many languages do not use the characters of U.S. English. Suppose you wanted to be able to
    15·1 answer
  • What is the behavior of an element with static positioning in regard to the page layout?
    12·1 answer
  • Table Setting in any occasion can add to the beauty and significance of the event. It may
    6·1 answer
  • Working mechanism of computer ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!