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]
3 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]3 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
What is the binary answer to the binary number 100 added to the binary number 11?
olasank [31]
I will use 0b to refer to binary numbers: ex: 0b1 = 1, 0b10 = 2

0b100 = 4 and 0b11 = 3

4+3 = 7

convert 7 to binary and you get 111.

Hope this helps, and May the Force Be With You!
<span>-Jabba</span>

6 0
3 years ago
Read 2 more answers
How does Python recognize a tuple?
Maru [420]

Answer:

You use parentheses around the data values.

Explanation:

j took the test on edge

4 0
3 years ago
Paragraph talking about why i chose bill gates
AlekseyPX

Answer:

Bill Gates

Explanation:

Bill Gates is known as one of the richest entrepreneurs in the world. He is responsible for creating the largest computer and technology business in the world, Microsoft. In the company's early days, no one would have thought that it would change both America and the world from that point on.

When Gates first created Microsoft,

Middle class Americans could now purchase a personal computer that would not put a set back in their bank account.As soon as personal computers started hitting the mainstream market, the demand for improvement began. People wanted their machines to boot up faster, have larger memory, have improved programming, and be easier to use. Luckily Gates already knew the people would have these needs, so development was already underway.

7 0
4 years ago
Jeremy is designing a website for a florist. He intends to discuss the web design with his client. Which tool should Jeremy use
stiv31 [10]

Answer:

C.  layout of each page with its respective elements

Explanation:

A layout  of each page with its respective elements will give the client a good idea of the final product and help him confirm his desires/requests towards the creation of the Web site.  Most people are visual, especially about things they don't fully understand, so a clear and visual representation is best.

<u>A. Bulleted lists and titles</u>... won't give the idea of the full layout of the Web site.

<u>B. chart depicting</u>....  that's more a tool for the programmer than the client, although user flow is important, it isn't as much as the visual aspect of each page.

<u>D. pictures and screenshots of websites of other florists..</u>. That could be a useful aid on the first contact, but the question implied the Web site is already in progress... so that wouldn't help much.

<u>E.  programming code for the website</u>, absolutely not, the client hired Jeremy not to have to deal with that.

5 0
4 years ago
Wireframing and storyboarding are helpful in which step of web development?
Thepotemich [5.8K]
Since wireframing and storyboarding are both part of the developing phase, I would think that the answer is Planning
4 0
4 years ago
Read 2 more answers
Other questions:
  • Which of the following correctly describes the reason for quality customer service?
    15·2 answers
  • Advancements in technology that might be helpful for individuals who need accommodations to perform computer tasks include _____
    15·2 answers
  • As part of his proofreading process, and to catch any spelling or grammar mistakes, John uses this feature in Word Online to hav
    7·1 answer
  • Which of the following is software? : Monitor Mouse Windows Keyboard Printer
    13·1 answer
  • Using a cell phone while operating a motor vehicle is considered distraction because
    8·1 answer
  • A wireless engineere has an access point using 5.725-ghz channel in the united states. In which band is the AP operating?
    9·1 answer
  • Which of the following does your textbook recommend for preparing PowerPoint slides? Group of answer choices
    9·1 answer
  • Searching for a particular record in a database is called “querying the data.”<br> True<br> False
    9·2 answers
  • What can the tab key do
    10·1 answer
  • A typical day in programming and software development would involve
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!