COS 126

Hello, World
Programming Assignment 0

Due: Wednesday, 11:59pm

The purpose of this assignment is to familiarize you with using the computer and with the mechanics of preparing and submitting assignment solutions. This assignment carries no grade, but you must do the electronic submission. Even if you're already a computer whiz, you might learn something!

You should learn to use emacs for editing files, netscape for browsing the World Wide Web, lcc for compiling programs, and /u/cs126/bin/submit for submitting programs. You may be able to complete this assignment during the first or second meetings of your precept, which will be held in CS Bldg. room 101. If not, try to go to the lab (CS Bldg., room 101) when an undergraduate lab assistant is scheduled to be there (usually 8-12pm) so you can get help. Don't be afraid to ask for help.

Your goal is to create, compile, and run the following extension of everybody's first C program (Kernighan and Ritchie, pp. 5-8).

#include <stdio.h>

main() 
  {
    int n;
    printf("Hello world! Give me a number:\n");
    scanf("%d", &n);
    printf("Thanks! I've always been fond of %d\n", n);
  }

Completing this assignment involves the following steps.

When you've finished this assignment, try out some of the other software you'll be using this semester. To browse the COS 126 Web pages, type

netscape http://www.cs.princeton.edu/courses/cs126/ &

You can also just type netscape &, click on netscape's Open button, and enter

http://www.cs.princeton.edu/courses/cs126/

in the pop-up dialog box. Cruise around the COS 126 Web; it is essential that you understand what's where and how to get to it.

You'll also use electronic mail a lot this semester. So, to get started, send us electronic mail telling us (briefly) whether or not you have previous programming experience, in which department at Princeton you might major, and anything else you'd like to say. To send us mail, type mail cs126, write your message, then Ctrl-d (i.e., press the Ctrl and the "d" keys simultaneously) on a line by itself to end the message. You can also terminate a message by typing a period (".") on a line by itself. If you're used to using some other mail program, feel free to do so.

To log out, position the mouse over the background, i.e., not over any windows, click the right mouse button, and select "Logout". Alternatively, you can just click the "EXIT" button in the Control Panel. Don't forget to log out!


Copyright © 1997 Robert Sedgewick