Menu

[Solved]Lab 18 Stack Lab Practice Coding Using Standard Template Library Stl Container Stack Char Q37126345

C++add comments
Lab 18 -Stack In this lab, we will practice coding using the Standard Template Library STL) container Stack. The characteriLab 18 -Stack In this lab, we will practice coding using the Standard Template Library STL) container “Stack”. The characteristic of a Stack is: “Last In First Out” The STL stack method include . pop: Remove the top element * push: Insert the next element . top: Access the next element * size: Return size * empty: Return whether the container is empty Here is a link to the stack class description on cplusplus.com: link to stack Write a program that reads in a list of names from a data file and stores them in a stack. Afterwards, it prints out the list of names in reverse order. Then, it prints the names in its original order. You are required to use the C++ STL Stack container (not using array or list) for this problem. You ma use more than one stack for the problem. Copy the data file using the following This is the expected output of your program: The list of 13 nanes in reverse order: Patrick Eddleman Joyce Doyle Susan Deno Abigail Nash Vivian Hoore Roy Fisher Morgan Freeman Michael Pitt Mark Zuekerberg Mick Jagger Billy Joel The list of 13 nanes in the original order Billy Joel Mick Jagger Mark Zuekerberg Richard Tennant Michael Pitt Morgan Freeman Roy Pisher Jill Jones Vivian Moore bigail Nash Susan Deno Joyce Doyle atrick Eddleman For this lab, you need to submit one file: main.cpp. Steps to edit, compile, run, and submit the program: If after you compile your program, there is compilation errors, then you need to modify the program according to the error messages. You may Now you can run the program, check to make sure the output is correct. If not, you need to modify the program and recompile and rerun the .Once you are able to sccssfully run the program with the correct outputs, you are ready to submit the program electronically. Only submit th need to edit and compile your program multiple times before it compiles successfully. program. source file. Locate the source file in your “project” directory under your “workspace” directory. For example, if you named your “workspace” coelite” under your home directory, and named the project “clal8 then “main.cpp” should be in-/codelite/clal8 directory Show transcribed image text Lab 18 -Stack In this lab, we will practice coding using the Standard Template Library STL) container “Stack”. The characteristic of a Stack is: “Last In First Out” The STL stack method include . pop: Remove the top element * push: Insert the next element . top: Access the next element * size: Return size * empty: Return whether the container is empty Here is a link to the stack class description on cplusplus.com: link to stack Write a program that reads in a list of names from a data file and stores them in a stack. Afterwards, it prints out the list of names in reverse order. Then, it prints the names in its original order. You are required to use the C++ STL Stack container (not using array or list) for this problem. You ma use more than one stack for the problem. Copy the data file using the following This is the expected output of your program: The list of 13 nanes in reverse order: Patrick Eddleman Joyce Doyle Susan Deno Abigail Nash Vivian Hoore Roy Fisher Morgan Freeman Michael Pitt Mark Zuekerberg Mick Jagger Billy Joel The list of 13 nanes in the original order Billy Joel Mick Jagger Mark Zuekerberg Richard Tennant Michael Pitt Morgan Freeman Roy Pisher Jill Jones Vivian Moore bigail Nash Susan Deno Joyce Doyle atrick Eddleman For this lab, you need to submit one file: main.cpp. Steps to edit, compile, run, and submit the program: If after you compile your program, there is compilation errors, then you need to modify the program according to the error messages. You may Now you can run the program, check to make sure the output is correct. If not, you need to modify the program and recompile and rerun the .Once you are able to sccssfully run the program with the correct outputs, you are ready to submit the program electronically. Only submit th need to edit and compile your program multiple times before it compiles successfully. program. source file. Locate the source file in your “project” directory under your “workspace” directory. For example, if you named your “workspace” coelite” under your home directory, and named the project “clal8 then “main.cpp” should be in-/codelite/clal8 directory

Expert Answer


Answer to Lab 18 -Stack In this lab, we will practice coding using the Standard Template Library STL) container “Stack”. The chara… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *