Computer Science Summer 07
Running your first program - sys lab version, Lab00, Unit 1

  • Download the "shell" programs for the course. These are partially written programs to guide you.

    1. Log onto your computer
    2. Applications, System Tools, File Browser
      This should be your home directory, your first initial, middle initial, and last name
    3. Up. to csl.tjhsst.edu
    4. Click on .common., then click on .compsci.
    5. Right click on the .CS. folder. Select .copy..
    6. "Home" - takes you back to your home directory. Paste in the CS folder to your home directory.
    7. Open JGrasp: Applications, Programming, JGrasp

  • Type in Lab00 from Unit 1

    1. File, New, Java
    2. Type in the program on page One-4 of the Unit 1 packet
      	//Your name, today's date
      	import edu.pace.World;
      	import edu.pace.Robot;
      
      	public class Lab00
      	{
      	    public static void main(String[] args)
      	    {
      	       World.readWorld("worlds/first.wld");
      	       World.setSize(10,10);
      	       World.setSpeed(6);
      
      	      //Create one object
      	       Robot karel = new Robot();
      	       Robot karel = new Robot();
      	      			
      	      //perform task
      	       karel.move();
      	       karel.pickBeeper();
      	       karel.move();
      	       karel.turnLeft();
      	      . . .
      	    }
              }
      
        
    3. Save this program as Lab00.java
    4. Save the program in the CS folder and in the Unit1 folder
    5. Use the "Generate CSD" button to check the indentation of your program. This also checks for simpler syntax errors (mistypings, things left out)
    6. Compile the program with the Plus sign button. This checks your program again for all syntax errors (but not logic or runtime errors)
    7. Run the program using the running-figure button.
    8. If the program does not run like you planned, type in necessary corrections, save, compile, and run again. Do this until your program runs correctly.
    9. When your program runs correctly, have the teacher or aide check off the program on the checklist.