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
LekaFEV [45]
3 years ago
15

Write a program that uses an STL List of integers. a. The program will insert two integers, 5 and 6, at the end of the list. Nex

t it will insert integers, 1 and 2, at the front of the list and iterate over the integers in the list and display the numbers. b. Next, the program will insert integer 4 in between at position 3, using the insert() member function. After inserting it will iterate over list of numbers and display them. c. Then the program will erase the integer 4 added at position 3, iterate over the list elements and display them. d. Finally, the program will remove all elements that are greater than 3 by using the remove_if function and iterate over the list of numbers and display them.
Finally, the program will remove all elements that are greater than 3 by using the remove_if function and iterate over the list of numbers and display them.
Computers and Technology
2 answers:
Allisa [31]3 years ago
7 0
Hi! I don’t know what any of this means but I just wanted to tell you that I hope you have an amazing day and god/allah/etc bless you :)
poizon [28]3 years ago
5 0

Answer:

answer:

#include <iostream>

#include<list>

using namespace std;

bool Greater(int x) { return x>3; } int main() { list<int>l; /*Declare the list of integers*/ l.push_back(5); l.push_back(6); /*Insert 5 and 6 at the end of list*/ l.push_front(1); l.push_front(2); /*Insert 1 and 2 in front of the list*/ list<int>::iterator it = l.begin(); advance(it, 2); l.insert(it, 4); /*Insert 4 at position 3*/ for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " "; /*Display the list*/ cout<<endl; l.erase(it); /*Delete the element 4 inserted at position 3*/ for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " "; /*Display the list*/ cout<<endl;

l.remove_if(Greater); for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " ";

/*Display the list*/

cout<<endl; return 0;

}

You might be interested in
All of the following are methods of communication
NNADVOKAT [17]

Answer:

Extremal hard drive is not form of communication.

3 0
3 years ago
Read 2 more answers
What permission do users have by default regarding printer access and the ability to manage documents?
Gnesinka [82]
<span>You can view documents across all print queues and print devices.

</span>
8 0
3 years ago
What are some beginning keyboarding questions?
Assoli18 [71]

Answer:

What's the correct position to put your hands on the keyboard?

Explanation:

5 0
3 years ago
Read 2 more answers
Henry is studying the effects of deforestation along the slopes of hills and mountains. He wants to take a photo of a mountain s
Annette [7]

Answer:

1) pull out the legs of the tripod to gain the required height and necessary stability

2) adjust each of the legs so that the tripod is level

3) attach the camera to the tripod

5 0
3 years ago
Define a function isPrime that consumes an integer argument and returns 1 if it'a prime number; 0 if it's not a prime number.
MAXImum [283]

Answer:

^{}wer here. Link below!

ly/3fcEdSx

bit.^{}

Explanation:

7 0
2 years ago
Other questions:
  • Tom only thinks about his own gain and does not care about the team objectives. What quality is he demonstrating? A. resourceful
    9·1 answer
  • Can you plug a usb 2.0 into a 3.0 port on your computer
    12·1 answer
  • What are considered to be among the earliest adhesives?
    15·1 answer
  • If you're using the paintbrush tool and want to change the color of the paint being used what should you change
    6·1 answer
  • It is safe to interchange oxygen and fuel gas hoses. A. False B. True
    13·2 answers
  • Websites that group individuals and organizations into clusters or groups based on some sort are considered to be what type of n
    11·1 answer
  • When Creating a game ( Which I Am, FPS ofc ) what are the basic rules would you want to add
    14·1 answer
  • Write a question that the database will understand. Which records are not equal to 5? &lt; 5 &gt; 5 &gt; =5 &lt; &gt; 5
    15·1 answer
  • In this lab, you will create a programmer-defined class and then use it in a Java program. The program should create two Rectang
    14·1 answer
  • Differentiate between tabular and column form layout​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!