How Do I

  1. How do I start putty so I can login onto the CS server and do programming? How do I check that putty is installed on my computer?
    1. Start Windows.
    2. Look for the putty icon. It says putty under it. The picture is of two computers connected by a yellow lightning bolt.
    3. If you do not see this icon, putty is not on your computer. Go go to step 2 below to download and install putty.
    4. Start putty by Double clicking on the putty icon. This pulls up a window.
    5. Click on the Run button in the window.
    6. This pulls up a connection window. Under "Host Name (or IP address)" enter the server name:
      Be sure to press the enter key after typing the name. This should connect to the CS server. Go to step 3 to complete logging into the CS server.
  2. How do I download and install putty?
    1. Start a browser.
    2. Go to the official putty download web site by clicking on the link.
    3. Scroll down to find the correct program. This would be


    4. Click on putty.exe, this pulls up a window.
    5. Click on Save File.
    6. Click on Save. Get out of the browser. You should have the putty icon on your screen.
  3. How do I logon to the CS server so I can program?
    1. Start putty (see Question 1 above).
    2. The next thing you should see is a terminal window provided by the server with the words
      login as:
      At this point you should enter your CS server user name (sent to you by email from me). Next the CS server asks for your password:'s password:
      where cs151dd is your user name, with the two d's standing for the last two digits in your user name.. Type in your password (also from that email). NOTHING appears on the screen. If you make a mistake you can use the backspace key. Press enter when you finish.
    3. You have logged on successfully if you now see your command prompt:
      where the dd's stand for last two digits of your user name. The command prompt is prompting you enter a command. Each time you enter a command, the command is carried out, and you are given a new command prompt so you can enter another command.

      When you use the pico command (see 5 below) to write a file, you interact with pico. You do not immediately get a new command prompt. Command pico collects what you type to be put into the file until you type ^O and ^X (see below). When you type ^X pico stops and you get a new command prompt.

  4. How do I Log Off the CS server? When you are finished working on the server, get back to the command prompt. (for instance if you are still in pico-- see below-- type ^X to get out of pico) then enter the command
    That is type exit and press the return or enter key.
  5. How do I write, save, compile, and run a C program?
    1. If not already logged on, logon to the CS server (see Question 3 above).
    2. Writing the Program: We will write our first C program file. Its name will be: first.c. Its goal is to print out the following message:
      This is program 1, it's my first!
      1. Enter the command: pico first.c
        That is, type the command and press the enter key. This command starts the pico editor which lets you write files, and in this case you want to work on the file first.c. Now type in:
        int main() {
          printf("This is program %d its my %s!\n", 1, "first");
      2. Now save your work. Type ^O (that is, hold down the ctrl or control key and type an O). This brings up the line:
        File Name to write: first.c
        You have the option of changing the name (backspace, type a new name). In this case just press the enter key to accept first.c as the file name for the program.
      3. Now get out of pico. Type ^X (type the X while holding down the ctrl key) to exit pico.
    3. You can check that you have been successful with creating the file by entering the command:
      Remember to press the enter key after typing ls. This command lists out all files in your account. You should see the name
    4. Compile the program. If your program has no grammar errors, the compile step makes a new file that contains the the machine language translation of your C code (program). This new file is executable, that is, it can be run on the computer. The compile command is gcc. The complete command is
      gcc first.c
      since we need to tell the operating system what C program file we want to compile. Remember to press the enter key.

      If the compiler detects grammar errors (syntax errors), it prints messages on the screen telling you about the errors. If you have errors, you must use pico:

      pico first.c
      to work on your C program. Once you have corrected the errors, re-compile the file. If no error messages appear, the compile has been successful. The machine language will be in a file, a.out. Again you can enter the ls command. It should show that you have two files: a.out and first.c.
    5. Run the program. Enter the command:
  6. How do I change an C program? You repeat the steps of question 5 above with the name of your program file in place of first.c.
  7. How do I use the Homework tab?
    1. Connect your browser to
    2. Logon with your Sycamore name and password.
    3. Click on Summer I 2014 CS-151-301 -Intro Computer Sci.
    4. Click on Homework (a tab on the left).
    5. If you want to find the due date of a problem, click on its name. Read the due date. Then click Cancel.
    6. Read the homework problem you want to work on. Follow the directions. Do read the course documents needed to work the problem (Note: You might need course material from earlier lessons). When you know the answer to the problem,
      1. Redo (if necessary) steps a-d above.
      2. Now click on the name of the problem you want to work on.
      3. Now click on Write Submission and type in your submission.
    7. When you are done click the Submit button.
    8. To include a file as part of your submission:
      Click browse for local file. Browse for the file you want to submit.
    9. When you find the correct file, click Choose.
    10. Finally click on Submit. This sends a copy of the file to your instructor.
    11. You may submit more than once. Click on the problem you want to rework. Click on Start new submission. I will grade you latest submission.
  8. Homework H0. This is just for practice. It is worth 1 point. Please read 7 above. Now get back to the course homepage. Then click on the homework tab and click on Homework H0. Click on "Write Submission", then type your name into the submission window and then click "Submit" at the bottom of the page. Your name is worth one point!
  9. Program first.c. Make sure you have first.c saved in your account. It must be correct. No syntax errors. No logical errors, ie the compiled version runs correctly (in this case it achieves the goal mentioned in 5b above). This is worth 5 points.