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
True or False?
Karo-lina-s [1.5K]

Answer:

The given statement is False

Explanation:

OSI or Open System Interconnection is a reference model around which the networks are built. OSI gives us all the information regarding movement of data from a software through physical means to another software. Generally it is used as a guidance tool. Seven layers combine to build an OSI model/

TCP/IP (Transmission control protocol/ Internet protocol) model is in a way implementation of the OSI model. It tells about the end-to-end transmission of data being transmitted using OSI model.

<h3>I hope it will help you! </h3>
5 0
3 years ago
Is the computer a device that calculates and has the independence and initiative for the actions it performs?
inna [77]

Answer:

The answer is "True".

Explanation:

In this question, the given statement is true because the computer is a device that receives information as input, analyzes information utilizing a program that provides relevant information for the processed data, and in this, it performs numerous calculation and all the calculation will be store in its memory, which is used in the future for collect data on hard drives.

8 0
3 years ago
Importing data is sending data to a new file.Is this true or false
Kipish [7]

false homie I gotcho


3 0
3 years ago
Read 2 more answers
You are the manager and an employee shows up for his shift dressed inappropriately for work. What should you do?
yarga [219]

Most managers see inappropriate dressing every day. Some are left angered while some are confused as to what is the right way to approach such situations. What follows next needs to be professional oriented. Being the manager, I would start by finding out what the appropriate dressing policies are. Some companies might have dress code policies while others might not. Assuming that this company has, I would read these policies carefully. The next thing that is required from me is to have a small conversation with the employee discretely. As professional as I can be, I will mention how I feel his or her dress code is inappropriate and try to summon the employee by asking him or her whether they are fully aware of the appropriate dress code. I will try to agree with the employee on what is appropriate and what is not. If we agree, requesting the employee to home and change clothes is unnecessary, but if the need to do that arises, I would consider that to be an option.

7 0
3 years ago
Read 2 more answers
What command would you use to copy the content of a file named report1 to another called report1uc. Convert the content of repor
Ray Of Light [21]

Answer:

Answered below.

Explanation:

This answer is applicable to Linux.

There are several commands for copying files in Linux. cp and rsync are the most widely used. cp though, is the command used to copy files and their contents.

To copy a file named report1.txt to another file named report1uc.txt in the current directory, the following command is run.

$ cp report1.txt report1uc.txt

You can change the case of the strings in the file by using the tr command.

tr [:lower:] [:upper:]

For example,

$ echo brainly | tr [:lower:]. [:upper:]

Result is BRAINLY.

7 0
3 years ago
Other questions:
  • Which of the following statements is true of a database? a. It is a collection of unstructured data. b. It is accessed primarily
    14·1 answer
  • I am confused about joins in sql.
    8·2 answers
  • What will be the output of “AAAAMMMMMHHHVV” using a file compression technique?
    10·1 answer
  • Difference between volatile and non volatile memory
    14·2 answers
  • Design a program that asks the user to enter a string containing a series of single digit numbers with nothing separating them.
    7·1 answer
  • A list is a collection that ______________
    9·1 answer
  • Explain the characteristics of 1st generation computers​
    15·1 answer
  • Lasses give programmers the ability to define their own types. <br><br> a. True<br> b. False
    10·1 answer
  • Write a function called mul_time that takes a Time_Elapsed object and a number and returns a new Time_Elapsed object that contai
    13·1 answer
  • you want to implement a protocol on your network that allows computers to find the ip address of a host from a logical name. whi
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!