CS 116
Introduction to Programming-II (C++)
Summer 98
Homework 0 - Due Wed 7/29/98
This homework does not require you to turn anything in. Instead, you
will just get to know the computing environment, learn the basics of
UNIX and Emacs, and write and run your first C++ program.
Follow each of these steps carefully. Contact me if you have trouble
with any of the steps.
- Log on to classes.cs.uchicago.edu. For example, if you are
using a Macintosh computer in the CS Dept's Maclab, simply start up
Telnet, do "Open Connection", and type in "classes.cs.uchicago.edu"
replacing the highlighted default machine name. Now use your harper
login and password.
- Now you are in an interactive UNIX "shell": you can type in
UNIX commands and the computer will perform them for you. Experiment
around with UNIX - There is a handout outside my office that takes
you through the basics.
- Now it's time for you to learn Emacs. Run emacs by typing
"emacs" at the UNIX shell prompt. Type "C-h t" (that is "Control-h"
and then "t") to start up the tutorial, which will teach you the
basics of Emacs. The reference sheets handed out in class comes will
come in handy, although at first you will only be using a handful of
Emacs commands.
- Having learned the basics of Emacs, you now know how to create
and save files.
- Using Emacs, create a file called "main.cc" containing one of
the simple programs we discussed in Monday's class. Don't forget
to save the file.
- Exit Emacs.
- At the UNIX shell prompt, type "g++ main.cc -o main". This
will turn your program into an "executable" file, i.e. something
you can run. The name of this executable will be "main". You can
use the UNIX "ls" command to see that the executable file "main"
appears in your directory.
- Run your newly created executable by typing "main" at the
UNIX shell prompt. At this point, "main" should create the output
discussed in class (Like "The colume of the box car is ...").
- That's it. You are encouraged to experiement around. If any of
the above steps give you trouble, send me email.
Good Luck.
email: behfar@cs.uchicago.edu