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
elixir [45]
2 years ago
5

Write a C++ console program to do the following: 1. Define an array of ints with the ten elements { 0, 1,2,3, 4, 5, 6, 7, 8, 9 }

. 2. Define a vector with those ten elements. 3. Define a list with those ten elements. 4. Define a second array, vect
Computers and Technology
1 answer:
Gemiola [76]2 years ago
7 0

Answer:

#include<iostream>

#include <vector>

#include <list>

using namespace std;

int main(){

int a[10]={0,1,2,3, 4, 5, 6, 7, 8, 9 };

std::vector<int> v (&a[0],&a[0]+10);

std::list<int> l (&a[0],&a[0]+10);

int b[10];

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

b[i]=a[i];

}

std::vector<int> v2(v);

std::list<int> l2(l);

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

b[i]+=2;

}

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

v2[i]+=3;

}

for (std::list<int>::iterator it = l2.begin(); it != l2.end(); it++)

*it=*it+5;

cout<<"Each containers value are: "<<endl;

cout<<"1st array: "<<endl;

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

cout<<a[i]<<" ";

}

cout<<"\n 1st vector: \n";

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

cout<<v[i]<<" ";

}

cout<<"\n 1st List is:\n";

for (std::list<int>::iterator it = l.begin(); it != l.end(); it++)

cout << *it << ' ';

cout<<"\n 2nd array: "<<endl;

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

cout<<b[i]<<" ";

}

cout<<"\n 2nd vector:\n";

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

cout<<v2[i]<<" ";

}

cout<<"\n 2nd list:\n";

for (std::list<int>::iterator it = l2.begin(); it != l2.end(); it++)

cout << *it << ' ';  

return 0;

}

Explanation:

  • Initialize an array, a vector and a list of type integer .
  • Create a 2nd array, vector, and list as a copy of the first array, vector, and list.
  • Increase the value of each element in the array by 2 , vector by 3 and list by 5.
  • Finally display the relevant results.
You might be interested in
Please help me with this coding problem :)
leonid [27]

Answer:

ll and lll

Explanation:

list dont be a looser

8 0
2 years ago
A skier provides what in a landscape photograph of a mountain?
liraira [26]
I think it may be D but all of them sound pretty important to get the perfect photo.  I tried researching and each website told me different.<span />
7 0
2 years ago
Read 2 more answers
A. Requiring computer users to log off before leaving for lunch
GuDViN [60]

Answer:

Option A, B, and D.

Explanation:

In the above question, the some details of the question are missing that is the part of the question.

Information Security applies to the mechanisms and techniques built and maintained to secure print, computerized, or any other type of personal, secret and confidential information or records from unauthorized access, usage, exploitation, release, damage, manipulation, or disturbance.

So, the following are the option that is true about the scenario.

Other option is not true about the scenario because Option C the click fraud are not the part or protect from the information security and Option F is not considered to the following scenario.

7 0
3 years ago
How do medical detectives investigate their cases?
tensa zangetsu [6.8K]

Answer:

Analyze genetic testing results to diagnose disease and study DNA evidence found at a “crime scene.” They solve medical mysteries through hands-on projects and labs, investigate how to measure and interpret vital signs, and learn how the systems of the human body work together to maintain health.

Explanation:

I answered it under the wrong part but this is same thing i put before.

4 0
3 years ago
Read 2 more answers
Look at the slide.
svetlana [45]

Answer:

c

Explanation:

5 0
2 years ago
Read 2 more answers
Other questions:
  • 10 10 105 Each process is assigned a numerical priority, with a higher number indicating a higher relative priority. In addition
    8·1 answer
  • As you are researching RAM for a computer you are building that will be used as a home office server for his small business. The
    5·2 answers
  • How to do this button ?
    14·1 answer
  • Deciding whether to explode a process further or determine that it is a functional primitive is a matter of experience, judgment
    8·1 answer
  • Which of the following instructions should be allowed only in kernel mode? (a) Disable all interrupts. (b) Read the time-of-day
    11·1 answer
  • Use the drop-down menus to complete the statements about changing mail options in Outlook.
    10·1 answer
  • _________________________ are the countable products resulting from a program, while ________________________ are the changes in
    9·1 answer
  • Ew<br>subject: Computer<br>11101÷101<br> binary operations<br>​
    7·1 answer
  • 7 TH GRADE QUESTION...PLS HELP
    12·2 answers
  • Which of the following expressions in Java is equal to 4?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!