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
Consider a system that contains 32K bytes. Assume we are using byte addressing, that is assume that each byte will need to have
Montano1993 [528]

Answer:

n = 15

Explanation:

Using

Given

Number of bytes = 32k

At the smallest scale in the computer, information is stored as bits and bytes.

In the cases when used to describe data storage bits/bytes are calculated as follows:

Number of bytes when n = 1 is 2¹ = 2 bytes

When n = 2, number of bytes = 2² = 4 bytes

n = 3, number of bytes = 2³ = 8 bytes

So, the general formula is

Number of bytes = 2^n

In this case

2^n = 32k

Note that 1k = 1024 bytes,

So, 32k = 32 * 1024 bytes

Thus, 2^n = 32 * 1024

2^n = 2^5 * 2^10

2^n = 2^15

n = 15.

6 0
4 years ago
When is e-mail an appropriate channel for goodwill messages? If you frequently communicate with the receiver by e-mail and are c
pshichka [43]

Answer: E-mail is an appropriate channel for goodwill messages when frequently communicate with the receiver by e-mail and are certain the message won’t get lost

Explanation:

Email is a fast and easy mode of communication in current time.

We can send a goodwill message to someone using email if we communicate frequently with that person.

This makes it easy to do a follow up also in case required.

Goodwill message should be written in simple sentences but should be sincere enough to convey the message to receiver. It short be short and caring.

Goodwill message contains a thanks expressing message from sender's side.

It might be sent for showing some sympathy, for example in case of any illness.

It can also be sent to recognize receiver for some good work that he has done.

8 0
3 years ago
What are two advantages of a pay-for-use online conferencing service compared to a free service? (Choose two)
tester [92]

Answer:

Provision of both audio and video

,dedicated support

Explanation:

Free services are not dedicated digital lines so there is no guarantee of high-quality sound or a reliable connection during the call. Some common issues  are background noises, crackling, echoes, distortion, quietness and drop-outs.Free services also don't offer dedicated support so if anything goes wrong there's nobody available to help you. Any of these problems can ruin the productivity and flow of your meeting.

5 0
3 years ago
A store sells rope only in whole-foot increments. Given three lengths of rope, in feet, the following code segment is intended t
Nonamiya [84]

Answer:

The correct option is option 3 which is The code segment works as intended but only when the sum of the three lengths is an integer or the decimal part of the sum of the three lengths is greater than or equal to 0.5.

Explanation:

As the variable minLength is defined as an integer thus the value is being truncated although the value of 0.5 is being added however if the decimal portion of the length is less than 0.5, the portion is truncated.

7 0
4 years ago
Read 2 more answers
What type of coverage pays for damage incurred as a result of theft, vandalism, fire or natural disaster?
Sloan [31]

Comprehensive or hazard insurance

5 0
4 years ago
Other questions:
  • In Microsoft Excel graphs are referred to as ______?
    14·2 answers
  • Data mining must usestatistics to analyze data.<br> True<br> False
    12·1 answer
  • ________ software provides a means of sharing, distributing, and searching through documents by converting them into a format th
    13·1 answer
  • How long Will it take me to master scada and plc programming?​
    9·1 answer
  • Use a logical OR to write a more concise equivalent of the following code:
    11·1 answer
  • Angle parking spaces are generally entered at an angle about __________ from the curb.
    8·2 answers
  • The premise of this exam is to synthesize your knowledge and understanding of recursion. Your synthesize may be in the form of a
    14·1 answer
  • Computer science - algorithms - flowcharts
    11·1 answer
  • You want to make access to files easier for your users. Currently, files are stored on several NTFS volumes such as the C:, D:,
    14·1 answer
  • A flowchart meeting is a process where members of the team analyze the design piece-by-piece to make sure it meets requirements
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!