# 122 Lab #1 Solved

This lab is comprised of two tasks. Both tasks must be completed in order to receive credit for this lab.
Please complete the online survey at http://survey.osble.org/index.php?sid=97282. Note that this survey may look very familiar to many 121 students :)
This task picks up from last week's lectures on developing dynamically expanding arrays (i.e. vectors). In lecture, we developed a vector of integers. In this lab, you must develop similar vectors for the other C data types: doubles and chars. In total, you must add to Vectors.h/c (provided with this file) the following structs and functions:
• A "DoubleVector_t" struct
• A "CharVector_t" struct
• DoubleVector_t doubleVector_init(int initial_size)
o Initializes a new DoubleVector_t for the programmer to use
• void doubleVector_resize(DoubleVector_t *some_vector, int new_size)
o Resizes a DoubleVector_t to the specified size
• void doubleVector_insert(DoubleVector_t *some_vector, int location, double value)
o Replaces the item presently at "location" with "value"
• void doubleVector_add(DoubleVector_t *some_vector, int location, double value)
o Shifts all values starting at "location" to the end of the vector right by one, then inserts "value" at "location"
• CharVector_t charVector_init(int initial_size)
o Initializes a new CharVector_t for the programmer to use
• void charVector_resize(CharVector _t *some_vector, int new_size)
o Resizes a CharVector _t to the specified size
• void charVector_insert(CharVector _t *some_vector, int location, char value)
o Replaces the item presently at "location" with "value"
• void charVector_add(CharVector _t *some_vector, int location, char value)
o Shifts all values starting at "location" to the end of the vector right by one, then inserts "value" at "location"
To receive credit for this task, you must implement a simple "driver" program that uses and tests each function.