| Lexington High School Mathematics | Math Dept. Front Page | Student Links | Family Links |
| Introduction to C++, Kevin Kelly | Kelly Front Page | C++ Course Guide | C++ Assignments | C++ Info |
This assignment will not be collected for grading. However, it is still important that you do this assignment to get ready for the following assignment.
Part 1: Write a program that allows the user to type in the first names of 10 people, then prints out these names in the reverse of the input order. (The name that is entered first would be output last, and vice versa.) You will need to store the names in an array. Use a declaration that begins with apvector<apstring> .
Part 2: Now modify your program to allow the user to decide how many names will be input. The user should first be asked to type a number, and then to type the list of names. For this to work, you will need to resize the array after the user inputs the desired size. (If you need a reminder of how to do this, see the top of page 91 in the textbook.) To test your program, run it at least twice, using lists of different sizes.