CS61C Spring 2011

1/18/11

 

Lab 1: Photos/Accounts

 

  1. Log into one of the machines in 200SD using your cs61c account. Change your password by starting a terminal and typing “ssh update”’. Follow the instructions on-screen to change your password.
  2. Personal Photo
  1. Open the Photobooth application on OS X via “Finder”->”Applications”->”PhotoBooth”. Take a clear photo of yourself (please don’t add any crazy effects) and drag the image to your desktop.
  2. From the terminal, switch to the “Desktop” folder. With an “ls” you should be able to see the filename of the photo you just created.
  3. Rename the file “me.jpg”, and type “submit lab1” from the terminal window to upload this file as your submission for lab1.
  1. You might have seen these program snippets in discussion:

        

Simple C Program

Simple Java Program

#include <stdio.h>

#define RC 5

 

int main(int argc, char* argv[]) {

int i;

for(i=0;i<RC;i++) {

printf("Hello World\n");

}

}

class HelloWorldApp {

  public static void main(String[] args){

     int RC =5;

     for (int i = 0; i < RC; i++) {

        System.out.println("Hello World!");

     }

  }

}

 

Quickly transcribe these programs into files, compile and run. This shouldn’t take more than a couple minutes. It’s just to make sure that your development environment is configured properly. You don’t have to demonstrate this to your GSI, but please do make sure both programs run as expected.