APCO/IASC 1P00 Lab 1
Week starting 17th September 2009
The objective of this lab is to get you familiar with the Department's computer systems, as well as the Jython Environment (JES) that we
will be using to learn programming. Programming is an area in which the best way to learn is to practice! There is nothing wrong with
working with a partner on any of these exercises — but be sure that
understand everything yourself.
New concepts frequently build
upon old ones, so stay on top of your work, and practice, practice, practice!
(with TA) of logging in, changing your password, familiarizing yourself with the file system (including Z-Drive.) See
Handout, with Syllabus, from first lecture
Walkthrough (with TA) of JES: Opening, Saving, Loading, Editing, and the difference between the two panes
Warmup and Exercises 1, 2 and 3 (see below). The bug on your screen will not be the
bug you'll encounter in this course!!
Continue to experiment with JES on your own
In the Command area or lower pane, enter these two lines (i.e. type just the highlighted text and press Enter after each line.) Note that
the three >s need not be typed—they make up JES's prompt:
>>> x = 5
>>> x = x + 4
What is the value in x after the second command? Can you explain why it has that value? (Use
to display the value.) What's the
new value of x if you repeat the second command? (Remember that you can recall the previous command(s) by pressing the up arrow
key.) Explain what happens when the following command is then entered:
>>> y = y + 12
What gets printed by the following? Try and work out each answer before actually executing the command in the interactions pane.
>>> print ((8 * 4) + (7 - 3)) / (2 + 4)
8 * 4
7 - 3
2 + 4
>>> temp1 = ((8 * 4) + (7 - 3))
>>> temp2 = 2 + 4
>>> print temp1 / temp2
>>> print temp2 / temp2
This exercise will demonstrate your ability to open a picture file, and display the image on your screen.
Copy, run and understand
Program 1, pg 30
. If you navigate to the MediaSources directory on the C: drive, you can obtain a
suitable picture file (a .jpg file). Read the text following the program in the book to learn about loading and running a program.
This exercise will demonstrate your ability to open a sound file, and play the sound back for you (us?!) to hear.
: Make sure that your
computer's volume is set to a reasonable (low) level — but not muted!
. Click the loudspeaker icon in the System tray (lower right corner
of the screen) to lower the volume.
Copy, run and understand
Program 2, pg 31
In this exercise, you are going to create a PDF file of the function you ran in Exercise 1, together with the picture that was output. As all
the assignments require you to submit PDF files of your work for marking, it is essential that you know how to create these files. (If you
use a Mac, the methods used might vary.)
Do Assignment 0.