CS107 - Lab 2

Due Monday 09/22 at the beginning of class.

In this lab you will cover:

The reading for this lab is Chapter 2 in the textbook.

Course software

Your personal Bowdoin username and password provide access to the software for this course. In the iMac lab, the following steps will connect you:

1. Select the menu item Go -> Connect to Server and type afp://collaboration.bowdoin.edu
2. Enter your personal Bowdoin login (e-mail) Name and Password.
3. A new icon called Computer Science will appear on the desktop.
4. Double-click the folder Computer Science -> csci107

The following folders are particularly useful for completing this and other assignments in this course.

csci107 -> Users -><your username> is a folder in which you can save work from week to week during the semester.

csci107 -> Invitation contains the lab software for many exercises in this course.

csci107 -> Drop Box is the place where you can submit an electronic copy of your completed work when you finish an assignment.

csci107 -> Lectures is a folder where copies of PowerPoint lecture notes will be kept during the semester, for your use.

Drag a copy of the folder csci107 -> Invitation to your desktop, and then close the folder csci107.

Creating a Glossary

Open the folder csci107 - Invitation that you copied to the desktop.

Double-click on the (multi-colored) icon Invitation (OSX). The following menu should appear:

Select the button Glossary. A page will appear that allows you to keep a glossary of terms and their definitions as you learn them during the semester. Try entering the terms "Computer science" and "Algorithm" into your glossary, along with their definitions that we discussed in class and the pages in your text where they are introduced.

When you are finished with this exercise, you can save your glossary on the desktop (give it the file name <your username>.glo). Finally, you can drag a copy of this file into the csci107 -> Users-><your username> folder, thus saving it for later use during the semester.

Once you are finished in the lab, be sure to drag the csci107 icon to the Trash - this step disconnects you from the server and prevents someone else (who uses this iMac later in the day) from accessing files in your personal folder by mistake.

Using the Search animator

Select the button Search Animator. A window will appear that allows you to simulate the step-by-step behavior of the sequential search algorithms in Figure 2.9 (page 46) and Figure 2.10 (page 53) of your text.

In this window, select Algorithm -> Search for Value, and then select the Run button. Watch each step execute and the Target value change. You may Reset and Rerun this exercise several times to get a feeling for the relationship between it and the date values.

Now select Algorithm -> Search for Largest, and then select Run again. Note the behavior of this new algorithm for each of several different sets of data values (using Reset and Run several times).

This search animator will be a useful assistant while you are answering the questions below.

Designing Algorithms

Complete exercises 3,4,5,7,8,9, 13, 15, 16, 17 on pages 61-62 of your textbook.

Be sure to justify your answers! You may do this work either by hand or with a word processor (e.g. MS Word). Also, you may choose to do this assignment either by yourself or in a group. However, solutions should be written up individually and handed in on Monday, at the beginning of class.

To submit a file electronically, you should first rename it so that you are identified as the author (e.g., give it a name like lab1-ltoma). Then drag the file to the csci107 -> Drop Box folder. Be careful not to drag an entire folder into the Drop Box; only a single file at a time can be submitted.

Once you are finished in the lab, be sure to drag the csci107 icon to the Trash (this step disconnects you from the server and prevents someone else, who may use this iMac later in the day, from accidentally accessing files in your personal folder) and log out!

Accessing the Course Software on the Web

If you have a computer in your room, and wish to download the course software to that computer, use Explorer or Netscape and follow these steps:

1.  Go to the Web site http://www.brookscole.com/cgi-brookscole/course_products_bc.pl?fid=M18&discipline_number=6, here.

2.  Scroll down this page and select our textbook (An Invitation to Computer Science - 2nd edition), and then select Lab Files.

3.  Enter the username "sgcpp" and password "ken".

4.  You may download the course software for either a PC (lab_software_pc-unix.zip) or a Macintosh (mac_lab_software.sit) from this page.