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]
2 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]2 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
You have the opportunity to meet some droids and Wookies!
scZoUnD [109]

Answer:

name = input("Enter name: ")

droids = int(input("How many droids you want to meet? "))

wookies = int(input("How many Wookies you want to meet? "))

   

print(name + " wants to meet " + str(droids) + " droids, and " + str(wookies) + " Wookies")

Explanation:

*The code is in Python.

Ask the user to enter the name, number of the droids and number of the Wookies

Print the name, number of the droids, and number of the Wookies

Note that while getting the input for the droids and wookies, you need to typecast the input the int (Since the values are int). Also, to print these variables, you need to typecast them as string in that format.

5 0
2 years ago
you are using linux and need to perform a reverse lookup of the ip address 10.0.0.3. which command would you use to accomplish t
ollegr [7]

A command you would use to perform a reverse lookup of the IP address 10.0.0.3 on a Linux system: dig -x 10.0.0.3.

<h3>What is a Linux command?</h3>

A Linux command can be defined as a software program that is designed and developed to run on the command line, in order to enable an administrator (end user) of a Linux network perform both basic and advanced tasks by only entering a line of text.

<h3>What is IP address?</h3>

IP address is an abbreviation for Internet protocol address and it can be defined as a unique set of numbers that are assigned to a computer, website or other network devices, in order to successfully differentiate them from one another in an active network system.

In Computer Networking, a command which an administrator (end user) would use to perform a reverse lookup of the IP address 10.0.0.3 on a Linux system is dig -x 10.0.0.3.

Read more on Linux commands here: brainly.com/question/25480553

#SPJ1

3 0
1 year ago
Which stroke of the four-stroke cycle is shown in the above figure?
Bogdan [553]

The Exhaust stroke.

The exhaust stroke is the final stroke of the four-stroke cycle engine. It occurs when the stroke valve is open and the intake valve is closed as can be seen in the picture above. The piston in this stage moves upwards from BDC to TDC. The exhaust valve opens other moving parts like the wheel which pushes the piston back to TDC. This action emits the spent air-fuel mixture through the exhaust valve.

7 0
3 years ago
Read 2 more answers
Create a console application, no user defined class is necessary for this program, all code is to be implemented in Main.
zheka24 [161]

Answer:

The code is designed using C++ with comments

Explanation:

#include<bits/stdc++.h>

using namespace std;

int main(){

int pay, hours; //declaring hourly pay rate and number of hours worked

cout<<"Enter hourly pay rate: "<<endl; //taking user input

cin>>pay;

cout<<"Enter hours worked: "<<endl; //taking user input

cin>>hours;

int gross;

if (hours<=40){

gross=hours*pay; //calculating gross pay

}

else if (hours>40){

gross=40*pay+(hours-40)*1.5*pay; //calculating gross pay for overtime

}

int withholding, netpay;

//calculation of withholding..

if (gross>1000){

withholding=(gross*28)/100;

}

else if (gross>600 && gross<=1000){

withholding=(gross*21)/100;

}

else if (gross<=600){

withholding=(gross*10)/100;

}

netpay=gross-withholding; //calculation of netpay

cout<<"Gross pay is $"<<gross<<endl; //output

cout<<"Net pay is $"<<netpay<<endl; //output

return 0;

}

8 0
2 years ago
Create a file named network.py. The file should be created in the same directory as health_checks.py, i.e., scripts. If you are
Archy [21]

Answer:

There is a distinction between where the script exists, given by __file__, and the current working directory (usually the place from which the script was invoked), given by os.getcwd(). It is not entirely clear from the question wording which one was intended, although they are often the same.

8 0
2 years ago
Other questions:
  • Image files are grouped into two categories: _____.
    5·1 answer
  • The "edit" command must allow the user to find a record in the list by director. If there are multiple records with the same dir
    12·1 answer
  • Instructions: Type the correct answer in the box. Spell the word correctly.
    5·2 answers
  • why do programs include keyboard shortcuts for certain actions? do you prefer the mouse or the keyboard/ why?
    7·1 answer
  • If you delete a sent message on gmail does the person still get it
    14·1 answer
  • Lindsay owns a candy store that typically makes all of its sales to tourists visiting a nearby zoo. Why might she decide to set
    15·2 answers
  • Which item converts a high level language program to low level machine instruction?
    5·1 answer
  • Write a class named Accumulator containing: An instance variable named sum of type integer. A constructor that accepts an intege
    14·1 answer
  • Complete the sentence
    6·2 answers
  • Write the Number class that can be used to test if the number is odd, even, and perfect. A perfect number is any number that is
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!