CMSC 162
Fall 2017
09/14/2017
Lab on Vectors and Classes
Due:  Thursday, Sept 21
9am 

Handin .

After you complete 1-3:
handin cmsc162 labvectors WorkWithVector.cpp
After you complete 4:
handin cmsc162 labvectorswithclass RoomVectors.cpp

Assignment:  (worth 15 points) 

Get the following files in the VectorsEx folder.

    cp  -r  ~scottmce/162files/VectorsEx  .

The -r says to get the contents of the entire directory.

 The directory contains the following files:
  • WorkWithVector.cpp
  • WorkWithVector.h
  • SumsTester.cpp
  • ContainsTester.cpp
  • MinTester.cpp
Only the WorkWithVector.cpp file should change for this exercise.   Your task is to complete the functions in WorkWithVector.cpp so that the Tester programs work as expected.  I suggest you do them in this order (which is the order they are in the file).

1)  Get the SumsTester.cpp program to work correctly.   Compile via   compile SumsTester.cpp  WorkWithVector.cpp
  • Complete the sumOf function for entire arrays.
  • Complete the sumOf function for partial arrays.

2)  Get the ContainsTester.cpp program to work correctly.   Compile via   compile ContainsTester.cpp  WorkWithVector.cpp
  • Complete the contains function for entire arrays.
  • Complete the contains function for partial arrays.

3)  Get the MinTester.cpp program to work correctly.   Compile via   compile MinTester.cpp  WorkWithVector.cpp
  • Complete the minOf function for entire arrays.
  • Complete the minOf function for partial arrays.
yl bar

4) Get the files in the VectorsWithClasses Directory.

    cp  -r  ~scottmce/162files/VectorsWithClasses  .

You will want to look at all of the files, but look especially carefully at the following files:
  • RoomInBuilding.h
  • RoomVectors.cpp

To compile, you will say    compile   TestRoomVectors.cpp    RoomVectors.cpp   RoomInBuilding.cpp

Your job is to complete the functions in RoomVectors.cpp so that they give correct output.