BGSU Logo
BGSU Home BGSU Academics BGSU Admissions The Arts BGSU Athletics Libraries Offices
Department of Computer Science
Computer Science Home Undergraduate Program Graduate Program Computer Science Faculty Academic Advising Mission and Vision
Small font Medium font Larger font Largest font
Left bracket CS 201 with Visual C++ Right bracket

The Horstmann textbook used in CS 201 provides sample classes that can be used in the programs you write. The first step is to download these files. Note that these files have been modified from the ones distributed with the text in order to enable them to compile properly with the compiler we are using.

Download needed files

The following instructions will tell you how to download the files you need. You only need to do this once.

  1. Right-click on the following link: http://www.cs.bgsu.edu/rlancast/download/cs201.zip.
  2. To download, select "Save Target As..." and choose your USB flash drive. On your home computer system, you can choose any location for this file.
  3. Find the file you just downloaded, right-click on it, and select "Extract All...".
  4. This will start a program to extract the files. Click "Next>" or "Finish" in each window you see.
  5. After you have completed this, you can delete the file named cs201.zip .

Running a program using the Employee, Time, or a graphics class

  1. Start Microsoft Visual Studio 2005.
  2. Choose File | New | Project and you will see this screen:
    New Project
  3. Click on Visual C++ in the left pane and click on "CLR Empty Project" in the right pane. Fill in the project name (Name:) and click the Browse button to select a directory for your project. Select a location on your personal hard disk or on a USB flash drive in a computer lab. Be sure that the box labeled "Create directory for solution" is unchecked. A new folder will be created in the specified location with the project's name. Then click OK. For this example, we assume drive E is the flash drive we are using.
  4. You will now have a solution folder whose name is the same as your project name. Copy the CS 201 files you downloaded above into the solution folder. For the Time class, copy ccc_time.h and ccc_time.cpp. For the Employee class, copy ccc_empl.h and ccc_empl.cpp. For the graphics classes, copy all files that don't refer to time or empl.
  5. In Visual Studio's Solution Explorer window (typically upper right), right-click on Headers, select Add Existing Item, and chose the header files that you just copied to the solution folder. (Use Ctrl-click to select multiple files.)
  6. Now right-click on Source Files, select Add Existing Item, and choose the cpp files that you just copied to the solution folder.
  7. Right-click on Source Files, select Add New Item. You will see this dialog:
    Add New Item
  8. Click Code in the left pane and C++ File in the right pane. Enter "main" in the Name field at the bottom and click Add. This will open a window for you to type your main program.
  9. Compile and execute your program by pressing F5 or clicking Debug | Start.
  10. If there are error messages in the bottom window, double-click on each message to go to the location of the error in your file. Fix the errors and attempt to compile and execute your program again.

webmaster@cs.bgsu.edu