Once this form has been customized for your institution, you can use this button to send your lab work. Be sure to read the instructions
before starting your work.
To gain experience with
In this exercise, you should use the standard list template. Write a program that reads in a sequence
of numbers and adds each input to the front of a list<int> object. (To add to the front,
use the insert function with the begin iterator position.)
Then iterate through the list and print each element.
. /* paste program here */
Run your program and describe its behavior.
One very natural operation that is not already a feature of the List class in the textbook is appending
an element to the head of a list.
Provide a new member function push_front(string e) class which will add the string e to the
start of the original list.
For example, if the list a contains Harriet, Jim and Carolyn, and e is Harry, then the command
a.push_front(e) changes a to contain Harry, Harriet, Jim, and Carolyn.
In this exercise, you must modify the pointers of the list. You may not use list iterators.
Test the append function by writing a main function that prints a list and then appends Employee
objects to a list. Then print out the combined list.
Using the Student class from Lab Notebook chapter 10, implement a stack to store students who have registered
for a course. Your program should prompt the user for students and majors, store these to a stack and then pop
the entire stack when the user requests this,
/* paste program here */
Since this might not be quite correct for registration, implement the same program as above, except with a queue.
Using the Student class, implement a map container and use the social security number as the index. Your program
should ask the user for a list of students and social security numbers. It should then allow the user to search
through the list of students using a social security number.
Don't forget to send your answers when you're finished.