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
liraira [26]
3 years ago
5

import java.util.ArrayList; // Needed for ArrayList class /** This program demonstrates how to store BankAccount objects in an A

rrayList. */ public class ArrayListDemo6 { public static void main(String[] args) { // Create an ArrayList to hold BankAccount objects. ArrayList list = new ArrayList(); // Add three BankAccount objects to the ArrayList. list.add(new bankAccount(100.0)); list.add(new bankAccount(500.0)); list.add(new bankAccount(1500.0)); // Display each item. for (int index = 0; index < array.size(); index++) { BankAccount account = list.get(index); System.out.println("Account at index " + index + "\nBalance: " + account.getBalance()); } } }
Computers and Technology
1 answer:
slega [8]3 years ago
7 0

Answer:

import java.util.ArrayList; // Needed for ArrayList class

/** This program demonstrates how to store BankAccount objects in an ArrayList. */

// Class ArrayListDemo6 is defined

public class ArrayListDemo6 {

// main method that begin program execution

public static void main(String[] args) {

// Create an ArrayList to hold BankAccount objects.

// The arraylist is called list

ArrayList list = new ArrayList();

// Add three BankAccount objects to the ArrayList.

list.add(new bankAccount(100.0)); list.add(new bankAccount(500.0)); list.add(new bankAccount(1500.0)); // Display each item using a for loop

for (int index = 0; index < array.size(); index++)

{ BankAccount account = list.get(index);

System.out.println("Account at index " + index + "\nBalance: " + account.getBalance());

}

}

}

Explanation:

The code is written in Java and more comments has been added to make it more explanatory.

The code snippet is a demonstration on Arraylist.

First Arraylist is imported. Then, ArrayListDemo6 class is defined. Then the main method which begin program execution.

Inside the main method, a new Arraylist is created called list.

Then we add three BankAccount object to the list.

Lastly, we use a for loop to display each added BankAccount object.

You might be interested in
Create a file name that to ensure the that the file is easy to find
levacccp [35]

Answer:

I always name mine something like HI

or YEET i dont know

why but it works

Explanation:

4 0
3 years ago
Read 2 more answers
A relational database is different from a simple database because it has more than one _____.
arsen [322]

Answer:

A relational database is different from a simple database because it has more than one _____.

The answer to this should be more than one tables

Explanation:

The main difference between simple database and relational database is there data storing technique like simple database store data in the form of files and in relational database for data arrangement tables are used where the header is the name of of attributes/columns and rows contain the values of those attributes. Other difference is that simple database might be single user but relational database is multi user. There are many other difference are also available which make Relational Database the advance version.

I hope it will help you!

5 0
3 years ago
In addition to the decimal number system, the number systems used most often in PLC operationand programming are ________.
otez555 [7]

Answer: PLC uses:

1. Decimal Number system

2. Binary Number system.

3. Octal Number system.

4. Hexadecimal Number system.

5. Binary Coded Decimal Number system.

6. Negative Number system.

7. Number Conversations.

Explanation: The other numbers the Programmable Logic Controller(PLC) uses aside the decimal number system are:

1. Binary Number system.

2. Octal Number system.

3. Hexadecimal Number system.

4. Binary Coded Decimal Number system.

5. Negative Number system.

6. Number Conversations.

7 0
3 years ago
_KOH + _Cu(CIO3)2 - __KCIO3 +<br>_Cu(OH)2​
Lyrx [107]
K- 1 x 2 =2
OH- 1 x 2 = 2
Cu- 2
(CIO3)- 6

K- 1 x 2= 2
OH- 2
Cu- 2
(CIO3)- 3 x2=6

2KOH+ Cu(CIO3)2 - 2KCIO3+ Cu(OH)2
8 0
3 years ago
Computers and Technology:
Monica [59]

Answer:

The algorithm:

Input days

sum = 0

for i = 1 to days

   input text

   sum = sum + text

end for

average = sum/days

print average

The program in pascal:

var days, sum, text, i:integer;

var average : real;

Begin

    write ('Days: '); readln(days);

    sum:=0;

    for i := 1 to days do begin

         write ('Text: ');  readln(text);  

         sum:=sum+text;

    end;

    average := (sum/days);

    writeln ('The average text is' , average);

End.

Explanation:

This declares all variables

var days, sum, text, i:integer;

var average : real;

This begins the program

Begin

This gets the number of days from the user

    write ('Days: '); readln(days);

Initialize sum to 0

    sum:=0;

This iterates through the days

    for i := 1 to days do begin

This gets the text for each day

         write ('Text: ');   readln(text);  

This sums up the texts

         sum:=sum+text;

End loop

    end;

Calculate average

    average := (sum/days);

Print average

    writeln ('The average text is' , average);

End program

End.

3 0
3 years ago
Other questions:
  • How does microchip work
    12·1 answer
  • Janice, who is 15, posts a picture of herself drinking alcohol and making an obscene gesture on her social networking page. Whic
    11·2 answers
  • Which are factors that go into a project plan? choose four answers
    14·1 answer
  • You want to create Web pages that can easily adapt to and serve multimedia content to smartphones, tablets, gaming devices and s
    13·1 answer
  • What is copy and paste?
    13·2 answers
  • What is a characteristic of maintaining logs in a system? A. Logging prevents security violations, but only deals with passive m
    10·1 answer
  • 17. When an industrial electrical circuit requires a 220 VAC single phase power supply, the electric power supply circuit is nor
    7·1 answer
  • Most C++ catastrophe vulnerabilities rely on uninitialized function pointers in a class.
    13·1 answer
  • Which of the following is an algorithm?
    15·2 answers
  • Why would you browse by entering a URL rather than use a link in a Web page
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!