CS 200 - Lab 2

In this lab you will experiment with integer values.

Getting Started

Download lab2.zip.  Save it on the Desktop.

Start Visual Studio 2005.  From the File menu, choose Import Solution....  Navigate to the Desktop and choose lab2.zip.  Click Open.

Your Task

The goal of the lab is to add assignment statements to the main function in the C source file called "Values.cpp".  Each of the int variables (a, b, c, d, e, and f) should be assigned values such that

When you run the program (control-F5), you will see some test output.  You have completed the exercise when the output looks something like this:

Test 1: check a + b == 121 at line 41 --> (121) PASSED
Test 2: check c + d == 0 at line 44 --> (0) PASSED
Test 3: check e + f < 0 at line 47 --> (-2094967296) PASSED
3 out of 3 tests passed

Note that test 3 is tricky: don't worry if you don't get it to pass (but you should think about how it is possible for the sum of two positive int values to be negative.)