COS 126

Hello, World using Your Windows PC
Programming Assignment 0

Due: Wednesday, 11:59pm

The purpose of this assignment is to familiarize you with the mechanics of preparing and submitting assignment solutions. This assignment carries no grade, but you must do the electronic submission. Follow these instructions if you want to use the LCC-Win32 system on your Windows PC. We provide different instructions if you prefer to use OS X on your Macintosh or Unix on the arizona workstations. Your goal this week is to learn to use LCC-Win32 system for editing and compiling programs.

If you have programmed before and are familiar with the Windows operating system, you may be able to finish this assignment quickly on your own. If you have not programmed before, or are hesitant about using Windows, we recommend that you bring your laptop and a network cable to the Friends center lab, and work on the assignment there. The lab will be staffed with knowledgeable TAs who can assist you. Don't be afraid to ask for help.

Your assignment is to create, compile, run and submit three short C programs. In addition, you will edit and submit a descriptive file called readme.txt with each of your assignments. (Instructions for the readme file are on the checklist for each assignment.)

PROGRAM 1 hello.c : Create, compile, run and submit the following extension of everybody's first C program.

#include <stdio.h>

int main(void) {
    int num;
    printf("Hello world! Give me an integer:\n");
    scanf("%d", &num);
    printf("Thanks! I've always been fond of %d.\n", num);
    return 0;
}

PROGRAM 2 hello-while.c : Create, compile, run and submit Hello World Exercise #5.

PROGRAM 3 hello-if.c : Create, compile, run and submit Hello World Exercise #6.

Completing this assignment involves a number of steps that are described below. The instructions refer to Program 1, but will be the same for Programs 2 and 3. These instructions were written for Windows 2000 users, but you should be able to adapt them if you are using a different version of Windows.


Setting Up and Logging In

Editing the program

Now you are ready to write your first program.

Compiling the program

Executing the program

Submitting the program

Browsing the COS 126 home page