Vectors

  1. Vectors, Procedural. Study Keyboard Shortcut Display feature of Eclipse described here. As you work on the below project, demonstrate to the instructor the usage of this feature.

    Create a project titled Lab12_VectorsProc. Implement the dynamically expanding and contracting container functionality described in previous labs using vectors. In the main() function, you may declare the vector to hold the integers input. Specifically, your program has to support this dialog:

    done? [y/n] n
    add or remove? [a/r] a
    input number: 5
    done? [y/n] n
    add or remove? [a/r] a
    input number: 8
    done? [y/n] n
    add or remove? [a/r] r
    input number: 8
    done? [y/n] n
    add or remove? [a/r] a
    input number: 3
    done? [y/n] n
    add or remove? [a/r] a
    input number: 12
    done? [y/n] y
    your numbers: 3 5 12
    

  2. Vectors, Object-Oriented. Create a project titled Lab12_VectorsOO. Re-implement the above functionality using the the following class definition.
Make sure your programs adhere to proper programming style. Submit your projects to the subversion repository. Do not forget to verify your submission on the web.