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
Vinvika [58]
1 year ago
15

9.11: Array Expander

Computers and Technology
1 answer:
vodka [1.7K]1 year ago
3 0

The Array Expander is an illustration of arrays and functions.

  • Arrays are variables that stores multiple values
  • Functions are named statements that are executed when called

<h3>The Array Expander program </h3>

The Array Expander program written in C++, where comments are used to explain each action is as follows:

#include <iostream>

using namespace std;

//This declares the Array Expander function

int* ArrayExpander(int *oldArr, int size){

   //This declares the new array

   int *newArr = new int[size * 2];

//This iteration sets values into the new array

   for (int i = 0; i < size * 2; i++) {

       if(i < size){

           *(newArr+i) = *(oldArr+i);

       }

       else{

           *(newArr+i) = 0;

       }

   }

//This returns a pointer to the new array

   return newArr;

}

//The main method begins here

int main(){

//This declares the length of the array, N

   int N;    

//This gets input for N

   cin>>N;

   int initArr[N];

//If N is between 1 and 50

   if(N > 0 && N <=50){

//This iteration gets values for the array

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

           cin>>initArr[i];

       }

//This calls the Array Expander function

   int *ptr = ArrayExpander(initArr, N);

//This iteration prints the elements of the new array

   for (int i = 0; i < N*2; i++) {

       cout << ptr[i] << " ";

   }

   }

  return 0;

}

Read more abou C++ programs at:

brainly.com/question/27246607

You might be interested in
g A sign of thrashing is Group of answer choices the CPU utilization increases as the degree of multiprogramming is increased. t
Bezzdna [24]

Answer:

the CPU utilization decreases as the degree of multiprogramming is increased.

Explanation:

The fundamental concept is that allocating a process with too few frames causes too many and frequent page faults. This implies that the CPU does not perform any useful work and thus its utilization would decrease drastically. In this case, the long-term scheduler, in a bid to improve the utilization of the CPU, would load more processes into the memory so as to increase the extent of multiprogramming. As a result, there would be more decrease in the utilization of the CPU, leading to a chained reaction of higher page faults, which is then followed by a corresponding increase in the multiprogramming degree, usually known as thrashing.

8 0
3 years ago
What software can be used for remote operation of a sunsdr2 dx?.
Rasek [7]

Answer:

Install the ExpertSDR2 Remote Client software on your PC. Download the client here. You can also access your device via any web browser

8 0
2 years ago
Write two sentences but each one having either computer in it or technology in it. You can use a word more than once in a senten
Ksju [112]

Answer:

Sentences:

1.My computer has a virus

2.Technology may take over the world someday

Explanation:

7 0
2 years ago
Read 2 more answers
You discover memory is corrupted, what would be an indication of a software vs. a hardware issue?
bearhunter [10]
Hey there!

Memory (RAM) is considered to be hardware since it is a physical component that makes up the computer and is accessed through the CPU rather than internal code that makes the computer run (which is software). Therefore, if you are having issues with the memory, it is likely a problem with a memory chip, making it a hardware issue. 

Hope this helped you out! :-)
8 0
3 years ago
A government agency is getting rid of older workstations. The agency will donate these workstations, along with other excess com
algol [13]

The simplest ways are being used to help eliminate the previously stored data, by deleting hard disc storage facilities with the same data wherever that used a sequence of all zeros.

<h3>What is a hard disc?</h3>

The "DoD Standard" is a term used during the data sanitizing industry and refers to DoD 5220.22-M, and the further discussion can be defined as follows:

The simplest ways are being used to help eliminate the previously stored data, by deleting hard disc storage facilities with the same data wherever that used a sequence of all zeros.

The sparging eliminates statistics to entirely delete the gravitational flux from electronic media.

Hard drives as well as other data storage devices, for example, computer tapes, retain magnetic data.

It could no longer be seen as storage after a disk is degaussed.

Therefore, the final answer is "Using the DoD 5220.22-M method and  Degauss media with a magnet".

Learn more about hard disc at:

brainly.com/question/13329582

#SPJ1

3 0
2 years ago
Other questions:
  • As faster processors are designed, a disparity has developed between the speed at which the CPU processes data and the speed at
    10·1 answer
  • Answer all 1).The most common layout of keys on the keyboard is the _____ keyboard. ASDF QWERTY JKL QWOPY,
    5·2 answers
  • Write a program that continually prompts the user for an integer input until input is entered that is less than 0. Each input th
    9·1 answer
  • A star appears under the <br> menu of the word processing program.
    5·1 answer
  • On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * r^n, where n is the distance
    10·1 answer
  • Elizabeth works for a local restaurant at the end of her shift she read she’s required to write in the time that she arrived in
    14·1 answer
  • Write a SELECT statement that returns three columns: VendorName from Vendors table, DefaultAccount No from Vendors table, Accoun
    10·2 answers
  • What happens to a message when it is deleted?
    5·2 answers
  • You are a librarian! Ask the user for the last names of the authors of the five books they are returning. Print a list of those
    15·1 answer
  • What method is used in the following line of code to associate clicking the left button with the event handler "clickSingle"?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!