COS 126: Spring 1997
Hello World
Due: Wed. 2/12, 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 it should be submitted. Do this assignment even if you're already a computer whiz; it's good for you.

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; the lab assistants are paid to help you.

Your goal is to create, compile, and run the following basic program.

#include <stdio.h>

int main(void) {
	int n;

	printf("Hello world! Give me a number:\n");
	scanf("%d", &n);
	printf("Thanks for entering %d\n", n);
	return 0;
}

Completing this assignment involves the following steps. If you run into problems, ask a lab assistant for help.

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. Alternatively, click on the Mail icon in the Control Panel and use the graphical interface to the mail system.

Experiment with the window system by creating and resizing windows, using the mouse, etc. Send mail to a friend. Try some basic UNIX commands (ls, cd, man, mkdir, to name a few). Make sure that you get reasonably comfortable with using the computer; it's going to be your constant companion this semester.

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 © 1996 David R. Hanson / drh@cs.princeton.edu
$Revision: 1.4 $ $Date: 1996/09/11 16:01:53 $