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
Jlenok [28]
3 years ago
8

Write a function called combineArrays(int[], int, int[], int) that accepts in two arrays of ints and the size of the arrays as p

arameters. The function should then create a new array that is the size of both array combined. The function should copy the elements from the first array into the new array, followed by all the elements from the second array. So if the initial array is {1,2,3,4,5} and the second arrray is {10,20,30} then the new array will be size 8 and contain {1,2,3,4,5,10,20,30}. Then in your main(), create two arrays of different sizes, each at least size 10, and fill them with integers's. Run the arrays through your function created above and print out all three arrays to demonstrate that the concatenation method worked. Then run your method again using the same two original arrays, but in the other order. So if the first time you did array a then array b, the second time do array b then array a. Make sure to delete the new arrays before closing your program.
Computers and Technology
1 answer:
Katena32 [7]3 years ago
6 0

Answer:

The function in C++ is as follows:

void combineArrays(int arr1[], int len1, int arr2[], int len2){

   int* arr = new int[len1+len2];

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

       arr[i] = arr1[i];    }

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

       arr[len1+i] = arr2[i];    }

   for(int i=0;i<len1+len2;i++){

       cout<<arr[i]<<" ";    }    

   delete[] arr;  }

Explanation:

This defines the function

void combineArrays(int arr1[], int len1, int arr2[], int len2){

This creates a new array

   int* arr = new int[len1+len2];

This iterates through the first array.

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

The elements of the first array is entered into the new array

       arr[i] = arr1[i];    }

This iterates through the second array.

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

The elements of the second array is entered into the new array

       arr[len1+i] = arr2[i];    }

This iterates through the new array

   for(int i=0;i<len1+len2;i++){

This prints the new array

       cout<<arr[i]<<" ";    }

This deletes the new array

   delete[] arr;  }

<em>See attachment for complete program which includes the main</em>

Download cpp
You might be interested in
Does kohl's sell homecoming dresses?? And if do you know what the price rage would be !!
SpyIntel [72]

Answer:

Yes, the prices are anywhere from $30-$100 dollars+tax

https://www.kohls.com/catalog/juniors-homecoming-dresses-clothing.jsp?CN=Gender:Juniors+Occasion:Homecoming+Category:Dresses+Department:Clothing

6 0
3 years ago
Wider channel bandwidth ________. increases transmission speed allows more channels to be used in a service band both increases
sattari [20]

Wider channel bandwidth decreases transmission speed.

<h3>What is Wider channel bandwidth?</h3>

Wider WiFi channel widths is known to be a bandwidth that is made up  of 40 MHz and 80 MHz width.

They are known to be used often in the 5 GHz frequency band. In this type pf band, there are said to have a lot of WiFi channels and also less overlapping channels and as such, Wider channel bandwidth decreases transmission speed.

Learn more about bandwidth  from

brainly.com/question/4294318

7 0
2 years ago
You must have an active ____ to test external links.
charle [14.2K]
Network & internet connection
4 0
4 years ago
The company where Derek works has tasked him with setting up and securing a SOHO router. He wants to make sure the wireless netw
Bogdan [553]

Answer:

Change default username and password.

Explanation:

The corporation under which Derek works has assigned him an assignment of establishing and safeguarding a SOHO router. He intends to ensure that maybe the wireless connection is protected and no further unauthorized person would connect the device to the router. So, the first task is to simply change the username and password that the wifi routers will be secured.

So, the following answer is correct about the given scenario.

6 0
4 years ago
Which of the following best explains how the Internet is a fault-tolerant system?
IrinaK [193]

Answer:

A

Explanation:

The Internet is fault-tolerant because cybercriminals can conceal their actions, allowing them the ability to carry out faulty actions without leaving a trace.

This statement is actually the same question I had to answer when in my 2nd year 1st semester in itt.
<3 enjoy

8 0
2 years ago
Read 2 more answers
Other questions:
  • For any element in keysList with a value greater than 60, print the corresponding value in itemsList, followed by a semicolon (n
    14·2 answers
  • You are attempting to open a file containing a list of integer numbers, each on a separate line, and read them into Python as in
    6·1 answer
  • Plz help me of this answer<br><br><br>language:python​
    7·2 answers
  • A printer is connected locally on Computer1 and is shared on the network. Computer2 installs the shared printer and connects to
    10·1 answer
  • What is the purpose of the domain name? The domain name is an example of a service provider. The domain name .gov.nz is an examp
    15·2 answers
  • What is a cell in computers
    7·2 answers
  • Secure shell (SSH) operates over which port by default
    9·1 answer
  • Which daemon manages the physical memory by moving process from physical memory to swap space when more physical memory is neede
    14·1 answer
  • Which of the following describe audio-editing software? Choose all that apply.
    5·2 answers
  • If ADD = 81, BAD = 49, and CAD = 64, then what is the value of ACA?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!