[SOLVED] CptS 122 Lab #1

20.00 $

Category: Tags: , , , ,
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Lab1.zip (818.7 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
πŸ”’ Securely Powered by:
Secure Checkout
5/5 - (1 vote)

This lab is comprised of two tasks. Both tasks must be completed in order to receive credit for this lab.
Task #1
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 πŸ™‚
Task #2
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.

  • Lab1.zip