School of Engineering and Applied Science
Department of Computer Science
CSci 53 -- Introduction to Software Development
http://www.seas.gwu.edu/~csci53/spring05
Prof. Michael B. Feldman
mfeldman@gwu.edu

Lab Exercise #1
for lab meeting Friday, Jan. 21, 2005

Completing Parts I-V is essential to getting started properly in this course.
Even if you miss the first lab session, or do not complete Parts I-V in that session,
you must complete the work as soon as possible.

This exercise will help you In this lab you'll be asked to type a series of commands. These are given in boldface fixed-width text. Everything must be typed exactly as given, including dots, spaces, etc.

Part I. Getting your accounts set up before the lab meets for the first time.

GW has two computer organizations, the School of Engineering and Applied Science Computing Facility (SEASCF) and GW Academic Technologies (AT). SEASCF manages the server you will use for this course, a Sun/Solaris Unix server called hobbes. AT manages the Windows computers in the labs and classrooms; you will use these as terminals to hobbes. So you will need student accounts from both organizations. There is no charge for these but you must apply in person. You must arrange for these computer accounts before your first laboratory meeting!
  1. Get a GWU network account, so you can use the computers in the lab room. You can do this at AT, on the B1 level of the Academic Center.
  2. Get your Unix account set up at SEAS, 4th floor, Tompkins Hall.

Part II. Getting ready to use your hobbes account for CSci 53.

  1. Go to a computer and use the "SSH client" program to log in to hobbes.seas.gwu.edu.

  2.  
  3. Once you're logged in, type the following to get your account set up:

  4.   . ~csjava/setup-53

    This must be typed in exactly as you see it, including the initial dot and the "tilde." If you have files in your file system from other courses, the setup script will leave those untouched. The setup process will, however, modify your .kshrc and .profile files to give you read-only access to the shared directories like programs53 and info.
     

  5. Once the setup is done, log off, then log in again.

  6.  
  7. Copy the file info/survey.txt into your file system:

  8.   cp info/survey.txt .
     
  9. Bring the survey form into the vi editor:

  10.   vi survey.txt
     
  11. Use the editor to fill in the requested information on the survey form. Be sure to give the e-mail address you will really use to receive e-mail related to this course. This address will be added to an electronic mailing list, and it is a requirement of the course to read e-mail at that address regularly (every day or so).

  12.  
  13. Save the survey back in your file system.

  14.  
  15. Send the survey as an e-mail message to Prof. Feldman:

  16.   pine mfeldman@gwu.edu <survey.txt

    and also to your lab instructor. Your lab instructor will tell you his or her e-mail address.

    Within the next day or so, we will both acknowledge receipt by sending a "thank you" message back to you. You will then know that we can communicate with each other.

Part III. Printing Hard Copy in the Lab.

  1. Open Netscape Navigator (NOT Internet Explorer) and type the following address in the location window:

  2. ftp://your-user-id@calvin.seas.gwu.edu
    (replace your-user-id with your SEASCF userid). When prompted, enter your SEASCF password.
     
  3. You'll see a list of the files in your top-level directory. Click survey.txt.

  4.  
  5. Use the Netscape Print command to print this file.
  6. Click on the folder csci53.
NOTE: If you are working in a SEAS lab (in Tompkins Hall), you cannot use ftp. On the other hand, you can mount your hobbes file system on the PC, as the "H:" drive, and treat it just as if it were an extra PC disk. You will need to use the above instructions if you are working on your project on any computer that is not in Tompkins!

Part IV. Compiling and Running Java Programs

  1. You must do all the work  for this course in your csci53 directory. Move to your csci53 directory

  2. cd csci53
     
  3. Examine the contents of your directory

  4. ls -l
    Briefly describe what you see.

     
  5. Copy 4 Java files from the programs53 subdirectory:

  6. cp programs53/Startup.java .
    cp programs53/WalkLine.java .
    cp programs53/WalkBox.java .
    cp programs53/SpiderTemplate.java .
     
     
  1. Display the contents of Startup.java:

  2. cat Startup.java
  3. Examine the contents of your directory; briefly describe what you see.

  4.  
  5. Compile the first of these three files.

  6. jcompile Startup.java
     
  7. Examine the contents of your directory again. What do you see this time?

  8.  
  9. In your Netscape window, reload, then click on the file Startup.txt. How does it differ from Startup.java?

  10.  
  11. Now execute (run) Startup:

  12. jrun Startup
    Briefly describe what happened.

     

     
  13. Now compile and run WalkLine and WalkBox. Briefly describe the results.

  14.  

Part V. Working with listing files and error messages.

  1. Bring SpiderTemplate.java into the editor.
  2. Introduce a syntax (grammar) error by deleting the semicolon at the end of the Spider.start() line. Save the file, then compile it to see the results. What happens?

  3.  

  4. In your Netscape window, load the listing file SpiderTemplate.txt. Observe the error message; summarize what it says.

  5.  

     
  6. Now in the ssh window, bring SpiderTemplate.java into the editor. Correct the semicolon error, but in the same line, introduce a spelling error into the word Spider. Compile the program once again. What happens?

  7.  

     

  8. Examine the listing file again by reloading it into the Netscape window.

  9. For your future reference, briefly describe what you've learned in this lab today.
     

     


(end of lab)