IntroductionSTL容器的Lab作业,基础用法,并不难,只不过要过测试集,细节方面还是要注意的。RequirementThe purpose of this lab is to gain some familiarity with an STL Container, and the use of an external iterator. For this lab you will NOT be creating any classes of your own. In fact you can do the whole lab in the main, although I think that you will see that it is highly advisable to have at least one non-member function since there is a task that is repeated.Begin by copying the file names.txt to your working directory. This file has a long list of first names, all taken from some of my classes. Briefly open it and look at it, or just skim through it with more names.txtAt the top of your program #includeas well as iostream, string, and fstream. Declare a multiset that is capable of holding strings.Fill the multiset with all the names in the file. (Since there are no spaces in the names you can use >> or getline.)Now declare an iterator that is appropriate for traversing the multiset. Set it to the beginning of the multiset full of names, and walk through the list, outputting each name it finds. (There are a lot of them, so you may want to separate them with spaces instead of putting one on each line.)Run and test this program. Your name should be somewhere in the list. (Note that the names are now in alphabetical order.)Here is the place where you want to pass your STL container to a non-member function, since we are doing something that is basically the same three times in a row. If you do you should pass the container by const and reference, since it is large. You will probably want one additional parameter.Declare two iterators.Move one of them through the list to the first name that begins with ‘M’. Since you know it is returning a string, you will know that (it).at(0) will return the first character in that string.Now set the second iterator equal to the first. Use it to count how many M names there are in the list. Print this number out.Using the second iterator, print out all the M names in reverse alphabetical order. (Remember that these are bidirectional iterators, so you –it works to go backwards.)Now do the above three steps for all the ‘C’ names and then for all the ‘Q’ names.If I had asked for ‘Y’ (I didn’t) the output would look like:There are 3 Y names in the listThey are:Yujia Yuanhang YingjieThis program has no user interaction. When you have it working, simply start a script. file, run the program once, and close the script. file.Submit your source code and the script. file to Blackboard.本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com 微信:codehelp
网友评论