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
Assume the system with 256B memory and 64B cache and the block size of 16 bytes. I.e., there are 4 blocks in the cache. (a) For
Nataliya [291]

Answer:

Check the explanation

Explanation:

1.

System = 256Byte = 8 bit

Cache = 64B , block size = 16 byte.

A) Direct Mapped Cache:

Block offset = log (Block size) = log 16 = 4bit

Total # of block inside cache = 4.

Therefore index offset = log 4 = 2bit.

Remaining is tag bits.

Therefore tag bits = 8-(4+2) = 8-6 = 2 bits

Tag                              Index offset                                Block offset

(2 bits)                             (2 bits)                                           (4 bits)

Fully associative cache :

In fully associative cache, any of main memory block can be placed anywhere in cache. Therefore index offset =0 bits.

Therefore tag bits = 8-block offset bit= 8-4 =4bits

Tag                               Block offset

(4 bits)                                (4 bits)

4 0
3 years ago
How many different bit strings are there of length 8 that contain the string 0000?
Nataly_w [17]

Answer:

answer is 8! / (4! * 4!). Which gives a value of 70.

Explanation:

we have 8 places, we’re going to pick 4 places to put the zeros, it is 8! / (4! x 4!)

3 0
1 year ago
How does communication resolve problems​
Deffense [45]

Answer:

One major benefit effective communication has in resolving a conflict is the resultant reduction in anxiety, whether within a family or in the workplace. ... Using effective verbal – and nonverbal – communications further contributes to a successful resolution of conflict, either between individuals or within a group.

8 0
2 years ago
Read 2 more answers
News video for cable does not need to be reformatted before being placed online.
vladimir2022 [97]

Answer:

True

Explanation:

5 0
2 years ago
Read 2 more answers
Widget Corp. wants to shift its list of inventory to a cloud so that its different branches can access it easily. The company ne
____ [38]

Answer:

The best cloud option for Widget Corp considering the cloud computing option should be cost-effective and should not expose mission-critical applications and data to the outside world.

Is a hybrid could.

Explanation:

The reasons behind this answer are that in the first place the cloud is not going to be fully managed by a third party, but also by the IT department of Widget Corp allowing it to control its security. Also, that the cloud can be adapted to public or mainstream sources, resources, and platforms. Making it very user friendly and lowering down specific knowledge to use it.

5 0
3 years ago
Other questions:
  • What is the term of social media
    14·1 answer
  • Write a program that determines a student's letter grade. Allow the user to enter three test scores. The maximum score on each t
    9·1 answer
  • A Windows user has been successfully saving documents to the file server all morning. However, the latest attempt resulted in th
    9·2 answers
  • A field with the extend data type can contain an attached file, such as an image, document, chart, or spreadsheet.
    6·1 answer
  • Which form of currency is not backed by gold today
    14·1 answer
  • Well the last week has been kind of terrible...
    9·2 answers
  • 200 points and brianlist if. done correctly... When working in Scratch, after clicking on the Choose Backdropicon and making you
    8·1 answer
  • Hola, alguien aquí me podría ayudar dándome ideas a cerca de office (Word, PowerPoint o Excel) estoy desesperada no puedo pensar
    11·1 answer
  • Just a quick question, how do you set something == to char and int in an if statement (java)
    10·1 answer
  • The different languages that follow specific RULES. These languages use commands
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!