
CS 121 Engineering Computation Lab
Lab 3
Department of Computer Science
Drexel University
February 2-6, 2009
©By the author. All rights reserved. Permission is given to CS121 Fall 2008
staff and students to use and reproduce these notes for their own use.
Your class instructor and TA
• Instructor for this section: Tim Cheeseman
Office: UC 147 (CLC)
• Your TAs are:
061 – Cem Sahin, Lloyd Ricks
561 – Pat Lockner
Note that verification sheet requires you to put
down instructor’s name.
Week 3 and 4 retrospective
• Lab 2: fourth week
• Limited Precision Arithmetic
• Data structure, functions
• Quiz 2: fourth week
• Getting stuck on problems during the quizzes?
– Use the Cyber Learning Center (UC147)!
– Use the discussion board for short questions
Lab 3
• Overview
• Part 1 Scripts (ch. 4 readings)!
• Assignments (function)!
• Part 2 User defined functions
• Part 3 Lists, sets and sequences
• Operations
• Random Number generation
• Reading in data from an external file.
Assignments
• Assignments are of the form
name := expression
where a is a variable and n can be an expression
• Name can be a single letter (upper-/lower- case
sensitive), or a combination of a letter followed by letters
and numbers and underscores.
A a a1 expr L eqn1 my_grade largestScore
• Some names are reserved by Maple and cannot be used
as something to assign to:
Pi for I end quit
Demo of Assignments
• p := x^2
x^2
• p
x^2
• p - 1=0
x ^ 2-1 = 0
• unassign(‘p’)
• p
p
• p-1=0
p-1=0
• p does not stand for “x^2” any more.