JAVA

Write a method that takes 2 parameters: an ArrayList list, and an int numRepeats representing the number of times to repeat each element in the array.


Return a new ArrayList with each element repeated numRepeats times.


For example, if we had an ArrayList list with the values ["hello", "world"]:


repeatElements(list, 3)

Should return a new ArrayList with the elements:


["hello", "hello", "hello", "world", "world", "world"]


public ArrayList repeatElements(ArrayList list, int numRepeats)

{


}

Answers

Answer 1

Answer:

Explanation:

The following Java code creates the repeatElements method as requested and uses the test case shown in the question to test the method. The output can be seen in the attached picture below.

import java.util.ArrayList;

class Brainly {

   public static void main(String[] args) {

       ArrayList list = new ArrayList();

       list.add("Hello");

       list.add("World");

       System.out.println(repeatElements(list, 3));

   }

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

       ArrayList newList = new ArrayList();

       for (Object x:list) {

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

               newList.add(x);

           }

       }  

       return newList;

   }

}

JAVAWrite A Method That Takes 2 Parameters: An ArrayList List, And An Int NumRepeats Representing The

Related Questions

can someone help me in my IT (information technology) homework

I am in 9th class and i will send the questions​

Answers

Answer is. Communication peed / time – money can be saved because it’s much quicker to move information around. With the help of ICT it has become quicker and more efficient. As Advantage And Disavantages is  Privacy - Though information technology may have made communication quicker, easier, and more convenient, it has also brought along privacy issues. From cell phone signal interceptions to e-mail hacking, people are now worried about their once private information becoming public knowledge.

3. Maria is in charge of consolidating the names of the participants of the two-day virtual
seminar. She wants to arrange the names alphabetically using MS Excel. Which of the following is
the correct sequence of steps in sorting text?
1. Click the Sort & Filter command. A drop down menu appears.
11. Choose Sort A to Z.
III. Select the cell range needed to be sorted.
IV. Go to the Editing Styles group of Home Tab.
A. I, II, III and IV
C. III, IV, I and I
B. II, II, IV and I
D. IV, l, ll and I​

Answers

Answer:

The correct sequence of steps in sorting text is;

III, IV, I and II

Which is option 'C' where the last item is II

C. III, IV, I and II

Explanation:

Sorting is the orderly arrangement of items (data) according to a specified criteria such as arranging a list of items alphabetically or a numerical arrangement of a data collection

Filtering is the selection for display, data that meets a specific condition

To arrange the names of the participants of the two-day virtual seminar alphabetically using MS Excel the sequence of steps are;

1. Select the rows or columns the are to be sorted by using steps for selecting  rows and/or columns

2. Go to the Editing group of the Home Tab ribbon

3. Click on (the down arrow besides) the Sort & Filter command icon to display a drop down menu with options for type of sorting and filtering

4. Choose Sort A to Z to sort the contents of the cell range in increasing alphabetical order

Therefore, the correct sequence of steps are;

III. Select the cell range needed to be sorted

IV. Go to the Editing Styles group of the Home Tab

I. Click the Sort & Filter command. A drop down menu appears

II. Choose Sort A to Z.

The correct sequence is III, IV, I and II.

Use the drop-down menus to match each description with the part of a report where it is located.

named moons in the solar system:
page number printed at the bottom of page 1:

page number printed at the bottom of page 20:

group of data titled “Hawks” in a report on species of migrating birds:

report titled “Technology in the Workplace”:

calculation printed beneath a group of data:

date of a report printed at the top of pages 2–100:

Answers

Answer:

1) Detail

2) Report footer

3) Page footer

4) Group Header

5) Report header

6) Group footer

7) Page header

Explanation:

I just did the assignment

What does a computer program use as a means to evaluate a condition as True or False?

Answers

Answer:

true

Explanation:

Answer:

A Boolean expression.

Explanation:

A Boolean expression is a logical statement that is either TRUE or FALSE . Boolean expressions can compare data of any type as long as both parts of the expression have the same basic data type.

20 POINTS-
can someone help with this?

Answers

Answer:

large storage= data warehouse

data from daily= world wide

data storaage= transactional

online data= relational

I rlly don't know I'm kinda guessing here for don't take my word to heart it's been a bit since I've learned this

You manage Windows desktops for your organization. You recently updated all of your workstations to Windows 10. Your organization relies on a particular application, which worked correctly on Windows 7, but now does not run in Windows 10. You have checked the application vendor's website, but they do not provide a Windows 10 update. What are your options for running the application

Answers

Answer:

The options for running a Windows 7 application on Windows 10 are;

1) Run the compatibility troubleshooter

2) Reinstall the app

Explanation:

The most recent version of Windows 10 supports the majority of applications made for versions of Windows before Windows 10, however, in the event that an application does not run on Windows 10 the options available for running the application are;

1) Run the compatibility troubleshooter as follows;

a) Type the application's name in the tax bar search box

b) In the menu showing the application that comes up, right click on the application's name and select the "Open file location option" from among the options menu

c) In the file location, locate and right click the program file which is the .EXE file and select "Properties" from the options menu. In the Properties dialogue box, select the "Compatibility mode"

d) In the "Compatibility mode" tab, select "Run compatibility troubleshooter"

2) Reinstall the app

a) With the app not yet installed on Windows, in the setup files location of the application, right-click the setup .MSI or .EXE application file

b) In the options menu select "Properties" and then the "Compatibility" tab in the "Properties" dialog box

c) On the Compatibility tab select the "Run this program in compatibility mode for" checkbox and select Windows 7 as your desired Windows

d) Click Ok.

Corinne would like to click on the link at the bottom of a Web page but she only sees the top portion of the page. She should _____. A.click twice on the status bar
B.use the scroll bar to scroll down to the bottom of the page
C.click on the back button
D.click on the display window and drag it up

Answers

Answer:

B

Explanation:

from 3dg3

Answer:

D.click on the display window and drag it up

Match the roles to the task they perform.

gather requirements
create software framework
identify errors in the software
develop program code for software

Role

software architects
business analysts
programmers
testers

Answers

Software Architects: “develop program code for software”

Business Analysts: “gather requirements”

Programmers: “create software framework”

Testers: “identify errors in the software”

Fill in the blank!!!!!!!!!!!!!!!!!!!! ASAP!! Please!!!
Recent improvements in __________ have increased the pace of globalization.

Answers

i think it is technology

so I believe that the word you are looking for is technology

Hope this helps

-scav

PLEASE HELP WILL GIVE BRAINLIEST

Answers

Answer:

Explanation: answer is b) the row comes first  in the  element of an index

Arranging a given set of data in ascending or descending order is ...................​

Answers

Explanation:

maybe it's answer is sorting

What is an "Expert System"?

If you can’t answer pls leave It

Answers

Answer:

program that use artifical intelligents

Explanation:

Expert system, a computer program that uses artificial-intelligence methods to solve problems within a specialized domain that ordinarily requires human expertise.

Sasha has just gotten a new job in a nearby city. After
comparison shopping, she found that renting a nice two-
bedroom apartment would cost around $800 per month.
Her utilities would cost about $150 per month.
Sasha has enough money saved for a down payment, and
she found that she can buy a three-bedroom house or
condo with a mortgage payment of $1,000 per month,
including taxes and homeowner's insurance. Her utilities
would cost about $200 per month.
Sasha's new.company has told her that she will be
required to move at her own expense in two years.
What should she consider before making her decision?
The monthly costs of renting and buying
The extra expenses needed for maintenance while
she lives in the house.
The amount of the down payment she will need to
make
The expense of selling the home when she leaves
the city

Answers

where is the question??

Explanation:

About C header files of C programming

Answers

Answer:

A header file is a file with an extension. Which contains C function declarations and macro definitions to be shared between several source files. There are two types of header files: the files that the programmer writes and the files that come with your compiler.

essence of radio program​

Answers

Answer:

Radio has the ability to reach across borders and can become a valuable source of information where reliable news is scarce. Radio has proved its worth in times of emergency such as when access to the mobile network is down as a result of an overload, or phone lines are cut.

Explanation:

in ICT what is the difference between Save and Save As

Answers

Choosing "Save" simply saves your work by updating the last saved version of the file to match the current version you see on your screen.

Choosing "Save As..." brings up a prompt to save your work as a file with a different name. For example, you might choose to save a document called "Paper - rev. 3" as "Paper - rev. 4". This way, you can save you file at different stages and keep multiple versions on your hard drive.

Choosing "Save" and then "Save As..." is also a good way to make a backup of your file. Just be sure to rename the file something new when you choose "Save As..." or you will overwrite the current saved version, just like choosing the "Save" command would do.

Answer:

Save updates the files that are already created.

Save as creates a new file or store the existing file in a new location.

Find what the secret message is. Get Brainliest if you are fast and correct.

Answers

Answer:

What does your digital footprint say about you?

Explanation:

Just follow the path from the end to the start, that's how I always get mazes.

Answer:

What does your digital footprint say about you?

Explanation:

When did computer networking go beyond the walls of the firm?

Answers

Answer:

All kinds of computing devices such as tablets, PCs, or laptops feature a brain-like unit called the central processing unit or CPU. Your computer's CPU calculates and interprets instructions while you're surfing the web, creating documents, playing games, or running software programs.

Explanation:

also have a good day people !!

Answers

Answer:

Thx u2!!

Explanation:

Everyone have a good day!

Answer:

You too and thank you for 50 points!!

Explanation:

Match each operating system drawback to its respective operating system.

1. more susceptible to viruses Linux. Operating System
2. fewer compatible applications Microsoft Windows Operating System
3. limited support system Apple Operating System

Answers

Answer:

Microsoft Windows - More susceptible to viruses

Linux - Limited support system

Apple - Fewer compatible applications

Explanation:

Generally windows is more susceptible to viruses.

Linux is open source meaning it's up to the community to help you.

Apple has been supporting more applications in these coming years but it still lacks the wide range of apps windows supports.

Answer:

1. Microsoft Windows is more susceptible to viruses

2. Mac OS X (Apple OS) has fewer compatible applications

3. Linux OS has a limited support system.

What is the dark, sticky substance that forms when tobacco is burned?

Answers

Answer: Tar.

Explanation:

A chemical substance made when tobacco is burned. Tar contains most of the cancer-causing and other harmful chemicals found in tobacco smoke. When tobacco smoke is inhaled, the tar can form a sticky layer on the inside of the lungs.

Complete the sentence with the correct response.

The central core of an operating system is called the .

Answers

Answer:

Kernel

Explanation:

The Kernel is the program that constitutes the central core of the operating system kernel is the first part of operating system to load into memory during booting kernel is made of various modules which can not be loaded in running operating system kernel remains in the memory during the entire computer session

top secret mission lolz

Answers

Answer:

whats the mission about??

Explanation:

~evita

What can be written to perform a certain number of iterations or to iterate until a specific result is achieved?

Answers

so in coding we use a thing called a loop to one of the most common loops is a if or loop this is when we tell the software to keep trying the task that is in the loop until it completes the task.

-scav

What is one similarity between low-and high-level programming languages? (5 points)
оа
Both are able to run programs quickly.
Ob
Both are human-friendly and easy for humans to read.
ос
Both are limited to certain types of hardware.
Od
Both are used to communicate commands to a computer.

Answers

Answer:

Both high and low level computer languages are used to communicate directly with a computer, so the answer is D.

Explanation:

A restaurant is interested in learning about the food preferences of people living nearby to the restaurant and intends to use survey data to help decide which new items to add to the menu. Which of the following is LEAST likely to be part of the process used to analyze the data?

a. Cleaning a data visualization to remove unwanted patterns.
b. Iteratively creating visualizations to ask and answer new questions.
c. Cleaning data to remove inconsistencies.
d. Filtering the data to look at the responses from only certain groups.

Answers

Answer:

answer is d

Explanation:

i got it right in code.org

Answer:

A. Cleaning a data visualization to remove unwanted patterns.

Explanation:

While cleaning data in its raw format can be an important part of the Data Analysis Process, the visualizations are not cleaned and/or altered but rather they are interpreted to discover what patterns exist in the data.

*If one is in search of a pattern, why would one clean or alter the pattern they have been provided, self-sabotage.*

What is the difference between electrical and electronic devices?

Answers

Answer:

A difference is that the electrical devices makes the electrical energy into the other forms of energies, such as heat, light, sound, gravitational, and nuclear. . . The electronic device controls the flow of electrons for performing the task.

Answer:

the different between electrical and electronics devices is the electricity and the power of inside of some devices which are considered most powerful electronics from, because the difference is the battery.

Explanation:

i hope it helps ;)

what is a soft ware?

Answers

Software is a collection of instructions and data that tell a computer how to work. This is in contrast to physical hardware, from which the system is built and actually performs the work. In computer science and software engineering, computer software is all information processed by computer systems, including programs and data. Computer software includes computer programs, libraries and related non-executable data, such as online documentation or digital media. Computer hardware and software require each other and neither can be realistically used on its own.

Answer:

it is like some data

Explanation:

5.7 AP-Style MC Practice edhessive
In Fantasy Football, participants compete against one another by choosing certain players from different NFL teams that they think will do the best on any particular week. Top Fantasy Football players spend hours every day looking at huge databases of statistics related to the players and the teams often using spreadsheets and software tools to gain new insights and choose the best players. This process could be considered an example of which of the following?
(DATA MINING)

Students are using data collected from a non-profit organization to try to convince the school board that their school should be in session year-round with several week-long breaks as opposed to the usual 9 months on and 3 months off. Information that was collected by this organization was as follows.

The location of the school (city and country)
The number of students at the school
Whether it was year-round or had the normal 3-month summer break
Scores on standardized tests (AP, SAT, ACT, etc)
The student handbook of rules and regulations
Results from a survey from teachers and students about happiness level and motivation level
They decided to make an infographic in order to try to easily display the data they had analyzed. Which of the following would be the best information to put on their infographic to try to convince the school board to change the schedule?

Select two answers.
(Association rules showing links between motivation and happiness levels and the type of schooling students were receiving.)

(A regression analysis of standardized tests scores comparing the two different types of schooling.)

Which of the following terms describes the conversion of data, formatted for human use, to a format that can be more easily used by automated computer processes?

(Screen Scraping

Answers

Answer:

1. Data Mining

2. A regression analysis of standardized tests scores comparing the two different types of schooling. || Association rules showing links between motivation and happiness levels and the type of schooling students were receiving.

3. Screen Scraping

Explanation:

1. The data analyze big data sets to gain insight, which a person can't do, so it is data mining.

2. A regression analysis shows the mathematical relationship between two variables. Association rule mining finds features of data points which determine the results of other features.

3. Screen scraping generally refers to process recordings.

9.6 Code practice Edhesive

Answers

Answer:

N = [1,1,1,1,1],

[2,2,2,2,2],

[3,3,3,3,3],

[4,4,4,4,4]

def printIt(ar):

   for row in range(len(ar)):

       for col in range(len(ar[0])):

           print(ar[row][col], end=" ")

       print("")

           

N=[]

for r in range(4):

   N.append([])

   

for r in range(len(N)):

   value=1

   for c in range(5):

       N[r].append(value)

       value=value + 1

           

printIt(N)

print("")

newValue=1

for r in range (len(N)):

   for c in range(len(N[0])):

       N[r][c] = newValue

   newValue = newValue + 1

       

printIt(N)

Explanation:

I got 100%.

In this exercise we have to use the knowledge of computational language in python to write the code.

We have the code in the attached image.

The code in python can be found as:

def printIt(ar):

  for row in range(len(ar)):

      for col in range(len(ar[0])):

          print(ar[row][col], end=" ")

      print("")        

N = [1,1,1,1,1], [2,2,2,2,2], [3,3,3,3,3], [4,4,4,4,4]

for r in range(4):

  N.append([])

for r in range(len(N)):

  value=1

  for c in range(5):

      N[r].append(value)

      value=value + 1

printIt(N)

print("")

newValue=1

for r in range (len(N)):

  for c in range(len(N[0])):

      N[r][c] = newValue

  newValue = newValue + 1

printIt(N)

See more about python at brainly.com/question/26104476

Other Questions
Sinx = [tex]\frac{3}{8}[/tex]Find cosx and tanx 1. The total area of all the faces of a three-dimensional figure is called the?Pls Answer Fast PLS PLS PLS which one of these sentences says arrogance?A. that aint my style B. and they knew casey wouldnt let that ball go by againpls answer will give brainliest Determine the future value if $5,000 is invested in each of the following situations: 7 percent for seven years If (3n-4)2 * = 310 then n= ? The pope is the bishop of Rome and is also the leader of the other bishopsTrueorFalse HELP PLZZZ Z DONT GIVE ME A LINK ratios that are equivalent to 9:6. Plz help me well mark brainliest if you are correct! 2. An RC car sold for $58.85. Thisamount includes a sales tax of 7%.What was the cost of the RC carbefore tax? Please help!First phtoto is the answer options for all questonsSecond image is the Questions 18. You've arrived at the Pecan Shellers conference - your first networking opportunity.Naturally, you're feeling nervous, but to avoid seeming insecure or uncertain, you'vedecided toA. square your shoulders before entering the room.B. speak a little louder than you would normally.C. talk on your cell phone as you walk around.D. hold an empowered image of yourself in your mind. When uncontrolled, the cell cycle becomes cancer. It forms lumps called..? Jacinta compares the volume of two boxes. Both boxes have a width of 2.5 inches, and a height of 10 inches. The larger box has a length of 8 inches. what is the volume of the larger box How does Cuba's government contrast with Costa Rica's government? Define Matrilineal and its significance. PLEASE HELP !! ILL GIVE 40 POINTS ; PLUS BRAINLIEST !! DONT SKIP ANSWER. If the Supreme court states that a law is constitutional, can the same kind of law be written by other states? Does pineapple belong on pizza? Explain your answer. HELP ME SOMEBODY PLEASE 8 more