Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, this is for programming with C++ . Below is the assignment and please please include comments, I really need the help. I thank you

Hello, this is for programming with C++. Below is the assignment and please please include comments, I really need the help. I thank you very very much.
image text in transcribed
image text in transcribed
Writing Code With The Standard Template Library 1. Let's create a brand new client file named stl.cpp. Within , include the libraries for string, the sequential container vector, the adapter stack, and the general purpose algo- rithms. Now, let's declare two stack objects named s1 and s2 that are templated to contain string objects. stack s1, s2; s1 push("Hi there") Push two different strings onto each stack. Compare s1 and s2. Print out a message indicating whether s182, s182, or s2s1 2. Next, declare an empty vector object named v that will contain integers 3. Write a void function named Initialize that will take v, read in five integers from the keyboard, and insert them into v. You will need to use the push.back operation which adds the item to the end of the array and increases the dynamic size of v. Include a call to this function from main. Make sure you use the pass by reference & symbol to preserve your changes for your parameter. 4. Write a void function named Print that will print out v. Include a call to Print from the main function 5. Write a void function named Reverse that will take a vector object as a parameter, reverse its contents, and preserve those changes. Include a call to Reverse and Print from the main function to check your function 6. Finally, sort your current v using the sort algorithm from the STL. Include another call to your print function to verify that it is indeed sorted

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

Explain the causes of indiscipline.

Answered: 1 week ago