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
To implement a small database, a database designer must know the "1" and the "M" sides of each relationship and whether the rela
elena55 [62]

Answer: True

Explanation:

The lines connecting an entity with a relationship whether single or double line refer to another constrain called “Existence Dependency Constraint” (also called “Participation Constraint”).

6 0
3 years ago
JAVA<br>plzz help...............​
patriot [66]

Answer:

import java.util.Scanner;

import java.util.Arrays;

public class Main {

 public static void main(String[] args) {

   Scanner scan = new Scanner(System.in);

   int numbers[] = new int[3];

   System.out.print("Enter first number: ");

   numbers[0] = scan.nextInt();

   System.out.print("Enter second number: ");

   numbers[1] = scan.nextInt();

   System.out.print("Enter third number: ");

   numbers[2] = scan.nextInt();

   scan.close();

   Arrays.sort(numbers);

   if (numbers[0] == numbers[2]) {

     System.out.println("All the numbers are equal");

   } else {

     System.out.printf("Greatest number: %d\n", numbers[2]);

   }

 }

}

7 0
3 years ago
Your wireless network has been breached and it seems as though the attacker has modified a portion of your data that is used wit
Vlad1618 [11]

Answer: IV attack

Explanation:

 IV attack is stand for the initialization vector attack that are used over the wireless network an it is used as the encrypted packet during the process of transmission. An initialization vector attack basically attempts for exploits for exposing the encrypted information.

 According to the question, the IV attack is basically used with the stream cipher for exposing the information wirelessly.

The initialization vector is one of the arbitrary number that are used in the for  of secret key in the system and it helps in prevent the duplicate character in ciperhtext.

 Therefore, IV attack is the correct answer.

8 0
3 years ago
The house had a wonderful pool of ... (his/its/our) own.​
-BARSIC- [3]

Answer:

its

Explanation:

"It" used in a number of different forms of sentences and has several rules. 'It' can be used in a sentence either for a Subject or an Object. It can be used as an introductory word in a sentence when there is no mention of the subject. It used for the singular, third-person pronoun. While it has many uses and according to the question, it is used to refer to a lifeless object (home).

6 0
3 years ago
Which method will return the first element in an ArrayList employees?
Wittaler [7]

Answer:

employees.get(0)

Explanation:

In the programming, the index of ArrayList start from zero.

So, the element start storing in the ArrayList from the zero index.

get() is the function which is used to retrieve or getting the value in the

ArrayList.

The function employees.get(0), it retrieve the element of zero index.

The function employees.get(1), it retrieve the element of first index.

The function employees.first(1), it is wrong calling.

The function employees.get(), it is wrong calling. you have to enter the index value inside the get().

3 0
3 years ago
Other questions:
  • A pacing calendar is provided to students so they can:
    8·2 answers
  • I just started game development using unity, I’m trying to control my sphere moving on a flat surface using the W,A,S,D keys, if
    5·1 answer
  • Universal Containers is tracking the interviewer's ratings of candidate in Salesforce. They would like to easily link the Candid
    5·1 answer
  • Write a java program that prompts the user to input the elapsed time for an event in hours, minutes, and seconds. The program th
    13·1 answer
  • What can you find the under the privacy policy section of a shopping website?
    12·1 answer
  • What are 25 items that trees made?
    6·2 answers
  • What type of version of visual studio is the visual studio express
    8·1 answer
  • Select the correct answer. Which is the bottom-most layer in the OSI model?
    9·1 answer
  • Which important aspect of the Roman Empire did the barbarians destroy?
    14·2 answers
  • can you still receive messages on messenger from a person when you deleted the conversation with them? (But not blocked them)
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!