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
Vesna [10]
3 years ago
8

JAVA

Computers and Technology
1 answer:
ella [17]3 years ago
5 0

Answer:

Explanation:

The following code is written in Java. It creates a function that takes in an ArrayList and an int parameter. Then it loops through the array and adds each element into a new array called newList but adds them the number of times that the numRepeats argument states. Output can be seen in the attached image below.

import java.util.ArrayList;

class Brainly{

   public static void main(String[] args) {

       ArrayList list = new ArrayList();

       list.add('a');

       list.add('b');

       list.add('c');

       ArrayList newList = repeatArrayList(list, 3);

       System.out.println(newList);

   }

   public static ArrayList repeatArrayList(ArrayList list, int numRepeats) {

       ArrayList newList = new ArrayList();

       for (int x = 0; x < numRepeats; x++) {

           for (int i = 0; i < list.size(); i++) {

               newList.add(list.get(i));

           }

       }

       return newList;

   }

}

You might be interested in
How many countries don't uses the metric system?​
aksik [14]

Answer:

The USA, Liberia, and Burma (a.k.a. Myanmar)

Explanation:

These are the only 3 countries that don't use the metric system

7 0
3 years ago
Read 2 more answers
What is the voltage drop across R4 in the diagram shown above?
pickupchik [31]
R₂ and R₃ can be replaced by:

R_5 =  \frac{1}{\frac{1}{R_2} + \frac{1}{R_3}} = 106 \frac23

The total R of the circuit is R₁+R₅+R₄ = 706 2/3

So the current in the circuit I=V/R is 100/(706 2/3) = 15/106 A
(I'm deliberately not trying to round the result)

The voltage drop over R₄ is V=I*R = 15/106 * 500 ≈ 70

So answer C would be my choice.

3 0
3 years ago
The groups_per_user function receives a dictionary, which contains group names with the list of users. Users can belong to multi
Akimi4 [234]

The groups_per_user function receives a dictionary, which contains group names with the list of users.

Explanation:

The blanks to return a dictionary with the users as keys and a list of their groups as values is shown below :

def groups_per_user(group_dictionary):

   user_groups = {}

   # Go through group_dictionary

   for group,users in group_dictionary.items():

       # Now go through the users in the group

       for user in users:

       # Now add the group to the the list of

         # groups for this user, creating the entry

         # in the dictionary if necessary

         user_groups[user] = user_groups.get(user,[]) + [group]

   return(user_groups)

print(groups_per_user({"local": ["admin", "userA"],

       "public":  ["admin", "userB"],

       "administrator": ["admin"] }))

3 0
3 years ago
"What technology will examine the current state of a network device before allowing it can to connect to the network and force a
EleoNora [17]

Answer: A. Network Access Control (NAC)

Explanation:

The CORRECT answer is (A.) <em>Network Access Control (NAC)</em>. NAC refers to an method used in computer protection in which aspects such as antivirus, or host intrusion prevention among others are somehow consolidated in order to unify endpoint security. Such an approach allows the system authentication to enforce network security.

7 0
3 years ago
You have been asked to delete some data from medisoft but find that there is no delete button. what is another method you can us
makkiz [27]
You can try shift +delete, backspace key or highlight text and delete are the ones I know.
7 0
3 years ago
Other questions:
  • Rachel is on her way to an interview for the position of a project manager. She is trying to prepare for this interview by analy
    6·1 answer
  • Chloe is building a kiosk-based Excel application. She wants to make some modifications to the screen elements in order to keep
    8·1 answer
  • What will be the output of the following Python code? class A: def test1(self): print(" test of A called ") class B(A): def test
    15·1 answer
  • What is the keyboard shortcut Ctrl+Z used for?
    14·2 answers
  • The acceleration of a body is 3 metre per second square what does it mean​
    11·2 answers
  • Write a C++ program to find if a given array of integers is sorted in a descending order. The program should print "SORTED" if t
    14·1 answer
  • . Which of the following is NOT a valid declaration for a character string?
    6·1 answer
  • Which best explains a password attached to a document?
    6·2 answers
  • The price of an item you want to buy is given in dollars and cents. You pay for it in cash by giving the clerk d dollars and c c
    6·1 answer
  • (40 PTS) Be specific
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!