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
What are the advantage of transistors over vacuum tubes?
marusya05 [52]

Answer:

Transistors are comparatively cheaper and consume less power as compared to vacuum tubes.

Explanation:

Transistor when compared to vacuum tubes perform much faster processing, are small and lightweight which enables it to integrate them into circuits.

They also show a high amplification factor than vacuum tubes.

7 0
3 years ago
XML Schemas consist of:
Contact [7]
None of the above is correct

4 0
3 years ago
Online arguments that progressively escalate into insults and harsh language where the bully threatens and tries to intimidate a
9966 [12]
█ Explanation <span>█

</span><span>An online argument that progressively escalate into insults and harsh language where the bully threatens and tries to intimidate another person is known as a flame war.

Answer: Choice D

</span><span>Hope that helps! ★ <span>If you have further questions about this question or need more help, feel free to comment below or leave me a PM. -UnicornFudge aka Nadia </span></span>
8 0
3 years ago
Read 2 more answers
Select the different network functions from the list below.
VashaNatasha [74]

Answer:

IP address

blocking spam

power

SAN

8 0
3 years ago
2.5 code practice
Mamont248 [21]

Answer:

try declarimg smt before the int eg answer=int(input("your answer"))

7 0
3 years ago
Other questions:
  • Why does the hp computer not have Bluetooth?
    6·1 answer
  • To join two or more objects to make a larger whole is to _____________ them.
    11·2 answers
  • Please help me ! All you do is just put it it all in your own words ! Please this is for my reported card!i don't know how to pu
    15·1 answer
  • Suppose arraylist list1 is [1, 2, 5] and arraylist list2 is [2, 3, 6]. after list1.addall(list2), list1 is __________.
    8·1 answer
  • The bearing of point p from A​
    15·1 answer
  • Which characteristic of a relational database distinguishes it from a flat file?
    5·1 answer
  • Switched backbone networks:_____.a. always use a ring topology.b. require much more management that do routed backbone networks.
    10·1 answer
  • Blank Are input instructions you give to a computer
    13·1 answer
  • Which of the following correctly describes the reason for quality customer service?
    9·1 answer
  • How to run angular project from github.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!