Updates | Course Schedule and Calendar | Course Material | TAs | Grade Distribution | Assignments | Robots and Garments | Course Info and No-Cheating Policy | Top of page

COMP 201: Principles of Programming

Dr. Grace Ngai, PQ 826, 2766-7279, csgngai _at_ polyu.edu.hk
Lectures:
Weekly Quiz: Thursday 11:30-12:30, PQ604A/B/C

Welcome to COMP 201 -- Principles of Programming, or, as I often argue that it should be named -- Introduction to Programming. We do not assume any prior programming knowledge in this course, we're here to help you get started with this very crucial skill that will carry you through the rest of your courses here in the Department.

Because of the size of this class, I have divided it into three sections. For the sake of consistency (I do not guarantee that all the sections will be going at the same speed), I would request that you not skip between the sections; though if you are unclear on some concept and feel that you could benefit from hearing the material a second time, do feel free to attend more than one section.


Updates | Course Schedule and Calendar | Course Material | TAs | Grade Distribution | Assignments | Python | Robots and Garments | Course Info and No-Cheating Policy | Top of page

Updates

This is where all the official announcements will be posted. Keep an eye out and check this page frequently for the latest information.


Updates | Course Schedule and Calendar | Course Material | TAs | Grade Distribution | Assignments | Python | Robots and Garments | Course Info and No-Cheating Policy | Top of page

Course Schedule and Calendar

Updates | Course Schedule and Calendar | Course Material | TAs | Grade Distribution | Assignments | Python | Robots and Garments | Course Info and No-Cheating Policy | Top of page

Text

We're going to be following a textbook, Python Programming: An Introduction to Computer Science, by John Zelle. It's an excellent text, but there are two problems with it:

However, there's some good news. Google Books (go Google!) has a FREE copy of the book online! You are strongly encouraged to use that version, and you will find that my lecture notes follow the book chapter fairly closely, with two caveats:

Lecture notes will be available latest by Sunday midnight for the following week's classes. I would strongly suggest that you print out your own copy of the notes and bring them to class.

  1. Objects and Graphics
  2. Data Collections
  3. Loops and Booleans
  4. Conditions
  5. Functions (without animations) and Functions (with animations, 104 slides!)
  6. Simple Decisions
  7. Strings
  8. Basic Loops
  9. IO and Data
  10. Introduction to Computing
  11. Introduction to Python

Updates | Course Schedule and Calendar | Course Material | TAs | Grade Distribution | Assignments | Python | Robots and Garments | Course Info and No-Cheating Policy | Top of page

TAs

Our TA for this course will be Simon Lui (email: csshlui _at_ comp.polyu.edu.hk). In addition, we also have some support from Roy Ho, our department's instructor. Roy's office is at PQ730 and Simon's office is at PQ713. You can feel free to hunt them down and ask questions about the coursework, but please remember the following:


Updates | Course Schedule and Calendar | Course Material | TAs | Grade Distribution | Assignments | Python | Robots and Garments | Course Info and No-Cheating Policy | Top of page

The grade distribution for COMP 201 is as follows:

Continuous Assessment60%
Final Examination40%

Please note that you need to pass both the continuous assessment and final examination components in order to pass the course.

The continuous assessment portion of COMP 201 will be made up of assignments and quizzes. The assignments will be divided into regular programming assignments as well as robot assignments. The grade distribution is as follows:

Regular Programming Assignments15%
Robot Programming Assignments25%
Weekly Quizzes (best of 10)60%

Updates | Course Schedule and Calendar | Course Material | TAs | Grade Distribution | Assignments | Python | Robots and Garments | Course Info and No-Cheating Policy | Top of page

Assignments

Assignments will be posted here as they are released.


Updates | Course Schedule and Calendar | Course Material | TAs | Grade Distribution | Assignments | Python | Robots and Garments | Course Info and No-Cheating Policy | Top of page

Python

Simon has written up a very good tutorial on how to install Python, how to install JEdit, a program editor, and how to run Python.

The programming language that we will be using in COMP 201 is called Python. Python is a scripting language that used in the real world (for example, the microblogging service Twitter uses a lot of Python), but it is also syntax-light enough that it is very suitable as a first language. We have discussed the merits of using different languages at length, and finally it was decided that Python would be suitable to give students the general idea of programming, first, before going into more syntax-heavy languages such as Java and C++.

Python is free for download, and I would suggest that you download and install it on your home computer, so that you can practice at home. You can either grab it directly from the official Python download page (make sure you get Python 3.1.1, not Python 2), or use the links below:

After you install Python onto your home computer, then you need to download a few more things to get your programs to work. First of all, we have the graphics library:

You need to save that file into the Python library where all the other Python modules are, so that Python will know where to find them when you import them. The directory for the library is:

The other modification that you need to make to your Python library is for the robots and the garments. However, for this one, we need to apologize to Mac users -- right now, we don't have libraries that support the Mac yet (yes, I know, it sucks, I use a Mac too!), so you will have to borrow a friend's PC, or install a virtual machine running XP. For the rest of you, here are two more files that you'll need:

pyserial is an executable. When you have downloaded it, double-click it to execute. It will ask you where you installed your Python. Type in the directory, and it will do the rest of the work for you.

pyRobot.py is a Python module. Save that into the same place as you saved the graphics.py file.


Updates | Course Schedule and Calendar | Course Material | TAs | Grade Distribution | Assignments | Python | Robots and Garments | No-Cheating Policy | Top of page

Robots and Garments

In addition to the usual programming assignments and quizzes, some of your assignments are going to be done on things that move -- robots and clothes. We're going to divide you all up into groups (that's your assignment 0), and each group will have either a robot or a vest to work with. You will get some motors or lights, and some sensors that "see" or "feel", and you'll use them to make your robot/vest do stuff.

The robot and the vest use the same set of electronics, and the assignments will be as similar as possible. You can check out a reference document for the electronics modules and see what's available and how to use it, as well as a quick rundown of the assignments that we'll going to be doing on the robots/garments.


Updates | Course Schedule and Calendar | Course Material | TAs | Grade Distribution | Assignments | Python | Robots and Garments | No-Cheating Policy | Top of page

No Cheating Policy

This is potentially the most serious issue in this course. COMP 201 has a no-cheating policy, which means that all instances of cheating will be severely dealt with.

Here is the no-cheating policy in COMP 201:

On programming assignments:

On Quizzes:

Anybody who breaks any of the quiz rules will be disqualified from the quiz immediately for a first offense. Subsequent offenses may result in failure from the course.

For examinations, I am assuming that you know what it means to cheat. If you didn't know that already, please come and talk with me. Students found cheating in examinations will have to face the university disciplinary council -- at the very least, the penalty will be failing the course; at the worst, it could result in expulsion.

If a student is found cheating in programming assignments (for example, if we find that he copied code from another student):

  1. For the first offense, the student will automatically be assigned a zero score for that particular assignment. The penalty will be applied to both the one who copies the work and the one whose work is being copied.
  2. For subsequent offenses, the students concerned will get a one-grade downgrade in their continuous assessment grade. Therefore, Bs will become Cs and Cs will become Ds. Again, this applies to both the copier and the one who let his/her code be copied.
Special warning --- A software package will be used to scan the programming assignments that the students have submitted. The software is capable of identifying copied assignments, even if the persons concerned have made superficial modifications to the code. You have been warned.