CS W1007x Introduction to Computer Science

Homework 0 (3 points)



We would like to get the semester off to a flying start! So, what class would be complete without an assignment asking you to write an essay describing what you did over break? Answer: this one. Rather, we want you to get started using the computers at Columbia, and UNIX in particular!

For Homework 0, we would like you to:

Due Date:

Tuesday, January 27, 1998 (section 1), Wednesday, January 28, 1998 (section 2).

Reading:

Chapters 1 and 2 ("The Art and Science of C" by Roberts)

The nitty-gritty for this homework:

  1. Log into your UNIX account.
  2. Explore the topics in the online UNIX tutorial, by typing "tutor" (now and later).
  3. Start up EMACS (type "emacs").
  4. Run the EMACS tutorial (control-h t) to learn EMACS (now and later).
  5. Use EMACS to make sure you have a file called ".profile" in your home directory with (at least) the line "export PATH=$PATH:~es66/bin" -- this will hook you up to the libraries for this course.
  6. However, after you edit .profile you need to logout and log back in to have the system reread your variables.
  7. "mkdir w1007" will create a space (directory) for this work (This and the commands below are at the dollar sign prompt.)
  8. "cd w1007" will go to that directory
  9. "pwd" will show you what directory you are in ("print working directory")
  10. "cp ~es66/inchtocm.c ." will copy some source code (don't forget that "extra" period at the end!)
  11. "ls" will show you there is a new file in your w1007 directory
  12. "cat inchtocm.c" will show you the contents of that file
  13. If you are typing into an HP in Mud, "rlogin cunix" will connect you to a remote computer that will allow you to compile.
  14. "gccx inchtocm.c -o inchtocm" will compile it. If it says it cannot find gccx, the PATH command above did not work for you -- make sure you did it correctly.
  15. "ls" will show you there is a new file, inchtocm
  16. "inchtocm" will execute it. If it says "not found," try "./inchtocm"
  17. Now, edit inchtocm.c so it performs the opposite conversion. Test it to make sure it works by compiling with gccx and then executing it.
  18. After you get it to work, "hand it in" by emailing your new source code to a TA who has office hours that are most compatible with your schedule. These office hours may change, and this will not necessarily be your TA. Use pine (or your favorite mailer) to send it -- you can use the control-r command (hold down the control key and press the r key at the same time) in pine to read in a file.

email: evs at cs dot columbia dot edu (Thanks to Andrew Kosoresow and Ivan Leichtling for helping develop this handout.)