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
Which of the following parameters should match in order for a pair of routers to form an adjacency when running OSPFv2? (Points
Gnom [1K]

Answer: Subnet mask

Explanation:

 Subnet mask is the type of parameter that should be match in order to form the adjacency for running the OSPFv2. The subnet mask is mainly used to identifying the address of network in the system.

The OSPF enable the router that must form an adjacency with the neighbors before sharing any type of data.

It mainly determine the neighbors links in the OSPF. The OSPFv2 router send the special type of message which is known as hello packet in the network.  

 

4 0
3 years ago
How do I do this??? (Im in 9th)
vlabodo [156]

Answer:

No clue!

can I get brainliest tho-

8 0
3 years ago
The LList class is (mostly) the same one discussed in lecture, but you must write a sort() function that uses one of the three i
Vladimir79 [104]

Answer:

see explaination

Explanation:

#include <iostream>

#include <string>

using namespace std;

class LinkedList{

class Node{

public :

int data;

Node* next;

Node(int data){

this->data = data;

next = NULL;

}

};

public :

Node *head;

LinkedList(){

this->head = NULL;

}

void insert(int d){

Node* new_node = new Node(d);

new_node->next = head;

head = new_node;

}

// sort the list with selection sort algorithm.

// Pick the smallest element in the unsorted array and place in the first element in the unsorted.

void sort_list(){

if (head == NULL){

return;

}

Node* current = head;

while (current->next != NULL){

Node* min_node = current;

Node* traverse = current->next;

while(traverse != NULL){

if(traverse->data < min_node->data){

min_node = traverse;

}

traverse = traverse->next;

}

int temp = current->data;

current->data = min_node->data;

min_node->data = temp;

current = current->next;

}

}

void print_list(){

Node* current = head;

while(current !=NULL){

cout<<current->data<<" ";

current = current->next;

}

cout<<"\n";

}

};

int main(){

LinkedList ll;

for(int i=0;i<10;i++){

ll.insert(i);

}

ll.print_list();

cout<<"*******************************************\n";

ll.sort_list();

ll.print_list();

cout<<"*******************************************\n";

}

8 0
3 years ago
_______________ is used by a hacker to mask intrusion and obtain administrator permissions to a computer.
Sergeu [11.5K]

Answer:

Rootkit.

Explanation:

Rootkit is a collection of software tools,mostly malicious.These are mostly used by hackers to obtain administrator permission to a computer by masking intrusion.

Root-kit is made from two word Root and kit.Where root refers to the name of privileged account on an operating system that is somewhat like unix and KIT refers to the tools used.

6 0
3 years ago
Consider an error-free 64 kbps satellite channel used to send 512 byte data frames in one direction, with very short acknowledge
Vladimir [108]

Answer:

The answer is "2".

Explanation:

In the given question some information is missing, that is "The propagation time for satellite to earth" which is "270 milliseconds" so, the description to this question can be defined as follows:

Given values:

Bandwidth = 64 kbps

Data frames = 512 bytes  

Propagation Time (t​​​​​​p ) =270 ms

Change Bandwidth  kbps to bps:

1 kb= 1024 bytes

calculated bandwidth= 64 kbps = 64×1024 bps = 65536 bps

1 bytes = 8 bits

512 bytes = 512 × 8 =  4096 bits

Frame length = 4096 bits

Formula

Transmission time (T​​​​​​t) = Frame length /Bandwidth

Window size = 1+2a

where a = Propagation time/Transmission time

Calculate Transmission time:

Transmission time (T​​​​​​t) = 4096 / 65536

Transmission time (T​​​​​​t)= 625 m.sec

Calculate Window size:

Window size = 1+2(270/625)

Window size = 1+2(0.432)

Window size = 1+0.864

Window size = 1.864

Window size = 2

3 0
3 years ago
Other questions:
  • A ____ client locates all or most of the processing logic on the server.
    11·1 answer
  • Which data type is most suitable for a password field
    12·1 answer
  • You have been using the same computer for several years. To extend its service life, you decide to upgrade the processor. You ch
    13·1 answer
  • The ash and dust from a volcanic eruption can cause a ______ change in the environment.
    8·1 answer
  • Which of the following is not considered format?
    8·2 answers
  • Which type of computer graphic can be blown up to a much larger size without getting distorted or losing quality?
    5·1 answer
  • Ask the user to input a number less than 100. Print all the numbers from that number to 100.
    6·2 answers
  • A location in memory which stores a value, the value can change as the program is running is
    12·1 answer
  • What is intellectual property rights law ?​
    8·1 answer
  • Define artificial intelligence?​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!