CS 101 - Introduction to Computing, Spring 2007

Lab 2

This assignment will have you use JES - Jython Environment for Students.

In the ACCC Labs that have JES, it can be found by:

  1. Clicking on Start
  2. Then click on All Programs
  3. Then click on Class Applications
  4. Then click on Engineering
  5. Finally click on Jython Environment for Students

Jython is an implementation of the python language written in the java programming language. So the real name of the programming language we are using is python. Files that contain python code are to use the file extension of

     .py
as in:
     lab2.py

Lab Assignment 2

Due: Tuesday 1/30/2007 by 11:59 pm

Write a python program in JES that will:

  1. Print out your name
  2. Print out your net-id
  3. Print out CS 101
  4. Print out your lab time

Remember that you will need to group your print statements together in a function. The first line of a function is written as follows:

    def name ():
Each function is to be given a different name, so you can give any name you want to your function. The keyword def and the punctuation will not change. The statements in the function must be indented by the same number of spaces and will follow the function's first line.

Once you have written the program, execute your function from the command area in JES. You will need to load your program in JES before you can execute it. To execute your function type in the function's name followed by the open and close paratheses.

Be sure to save your python program, because you will need to turn it in electronically. Save it using a meaningful name like "lab2.py". Actually saving your python program will automatically occur as part of the load operation in JES.

If you look at the python examples page for the examples from Lecture on 1/23/2007, you will see code that almost does what you need to do. Your code should be patterned after the code in the function doSomething (). While the function doesn't do exactly what the lab requires, you can modify the function to correctly satisfy the requirements of the lab.

You are submit your program electronically by placing it in the digital drop box in blackboard. Programs that are correct and submitted by the end of the student's lab time on the Wednesday the lab assignment is discussed will receive an extra 10% on the score of the lab.

We will spend more time in lecture on Thursday learning about JES and you can check out some power point slides about JES

Comments on the ACCC Labs

On the computers in the ACCC Labs there should an H: drive. This drive is actually a networked connection to your own file space maintained by the ACCC. No matter what machine you use or what lab you are in, the H: drive will access the same file space. This means that you can save a file on the H: drive on a computer in one lab and access that same file on a computer in another lab. This can be very helpful. It is suggested that you store your python program files on your H: drive.