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
enot [183]
3 years ago
10

"assignment is to create a program that will read a value from an array, and then place this value in another array with the loc

ation shifted by a certain amount. The array may be of any length from 2 to 100. Your program must be flexible enough to produce the correct solution regardless of the array size"
Computers and Technology
1 answer:
White raven [17]3 years ago
5 0

Answer:

#include <iostream>//including libraries

using namespace std;

int main()

{

int arr[6] = { 0,1,2,3,4,5 };//make sure size of arr is 1 less than secArr

int secArr[7];//second array (1 element bigger)

for (int i = 0;i < 6;i++)//looping through each element (6 times)

{

 secArr[i + 1] = arr[i];//transferring elements to second array and shifting by 1 cell

 cout << secArr[i + 1] << endl;//printing elements of second array

}

return 0;//terminating program

}

Explanation:

The array size can range from any number. just make sure to keep arr one less than secArr. This is because we need the room for the extra element. This task is to help you understand how array work and how to parse through them using loops. For loops are the best for this task because even if you think intuitively, they work for as long as there are items in the array. and you can define the size yourself.

You might be interested in
In order to "print" the data in an object, the class should override the _____ method.
Olegator [25]

Answer:

toString is right Answer

Explanation:

If you want to represent any object as a string, toString() method comes into existence.  

The toString() method returns the string representation of the object.

If you print any object, java compiler internally invokes the toString() method on the object. So overriding the toString() method, returns the desired output, it can be the state of an object etc. depends on your implementation.

7 0
4 years ago
Which characteristics describe the WMV video file format? Choose all that apply.
Lelechka [254]

Answer:

the answer is A, B, C hope this helps.

8 0
2 years ago
Finish the code to search for a 7 in the array.
guapka [62]

Answer:

The complete code is as follows:

from array import *

myArr = array('f',[3, 5, 7,3, 10])

location = myArr.index(7)

print(str("7")+" is at position "+str(location+1))

Explanation:

I made corrections to the third line of the code and I added a line

This line gets the index of 7 from the array myArr using the index keyword

location = myArr.index(7)

This line prints the position of the 7 in the array

print(str("7")+" is at position "+str(location+1))

8 0
3 years ago
........................ allows you to press a key or code for insertion of long phrases that you may require using repeatedly w
ollegr [7]

Answer:

text expander

Explanation:

5 0
3 years ago
Read 2 more answers
Three consecutive even integers heve a sum of 66. find the integers
Drupady [299]
Let us call x the smallest integer<span>. Because the next two </span>numbers<span> are </span>consecutive even integers<span>, we can call represent them as x + 2 and x + 4. We are told the </span>sum<span> of x, x+2, and x+4 is equal to 72. This means that the </span>integers<span> are 22, 24, and 26.</span>
6 0
3 years ago
Other questions:
  • "which part of an information system consists of the rules or guidelines for people to follow?"
    9·1 answer
  • In order to be accredited by the Better Business Bureau, a business is required to publish a privacy notice on its website that
    9·1 answer
  • The graph of which function has an axis of symmetry at x=-1/4​
    15·1 answer
  • The exercise instructions here are LONG -- please read them all carefully. If you see an internal scrollbar to the right of thes
    12·1 answer
  • The OnStar system allows Select one: a. a vehicle owner to initiate a conversation with an OnStar representative. b. the vehicle
    8·1 answer
  • Computers help eliminate the repetitiveness of manual tasks. How can this benefit you in your overall career?
    9·2 answers
  • What happens to a data table when the formulas or variables used to create it are changed?
    9·2 answers
  • . When attempting to minimize memory usage, the most efficient way to do group processing when using the MEANS procedure is to u
    13·1 answer
  • WILL GIVE BRAINLIEST!!!!!! 10 POINTS!!!!
    14·2 answers
  • What do we call the software which programmers use to program?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!