Introduction |
This first "programming" assignment is not a "programming" assignment at all;
it is designed to ensure that you know the fundamentals of using the
computing infrastructure for this course, both on your own machine (if you
have one) and the computers in our labs.
Primarily it concerns starting to learn to use the Eclipse Integrated
Development Environment (IDE) for Python programming.
To do this assignment, you must have already downloaded and installed Java, Python, and the Eclipse IDE on your own computer (or be using one of the UCI Lab machines, where it has already been downloaded/installed). Follow the Download/Installation Instructions for your machine, if you need to. Ensure that you have correctly setup the courselib folder and populated it with the required Python modules: otherwise some of your import statements (in parts B, C, and D) will produce errors. Carefully read and follow the instructions below. It would be an excellent idea to print a copy of this web page, read through it, and highlight any details that you think are important (and might forget as you are working on the assignment) or that you are confused about. Some students lose points for failing to follow directions properly; this is a problem that gets worse during the quarter, so starting out by doing the "right thing" in this assignment is an excellent idea. If you have any questions about these instructions, for example, if you think they are in error, or just confusing, please post on the appropriate MessageBoard Forum; and make sure you examine the posts from other students. IMPORTANT: Ensure that your Checkmate submission is for the current/correct Quarter, not the previous one. Finally, carefully read the last two sections, on Extra Credit and Time Management at the end of this assignment. These important sections are relevant to all programming assignments, but appear only in this one. |
Part A: Create a New Project and Script |
Read the
Python Programming in the Eclipse IDE
web page (which is also accessible on the
Handouts
web page).
It includes all the information that you initially need to know about using
Python in the Eclipse IDE.
This includes
In Part A you will run the Python interpreter to compute an answer, create a new project in the Eclipse workbench, create a new (trivial) script (using the answer computed by the interpreter) without syntax errors, run it to ensure that it executes correctly, and finally submit the script on the Checkmate Homework Dropoff system. Here is a checklist of things to do. If you are confused or run into problems with any one, ask for help as soon as possible.
|
Part B: Debug an Old Project's Script |
In Part B you will download and unzip a project and put it into the Eclipse
workspace, create a project for it in the Eclipse workbench, correct the
syntax errors in the script, run it, correct the execution errors in the
script, and finally submit the script on the Checkmate Homework Dropoff sytem.
Before beginning this part of the programming assignment, read the short
handout on
Bugs.
Here is a checklist of things to do.
If you are confused or run into problems with any one, ask for help as soon as
possible.
Bottom LineYou will be writing many programming assignments during the quarter, requiring you to create new projects or modify existing ones. You should be able to manipulate both kinds of projects easily in Eclipse, and submit them for grading in Checkmate.Finally, whenever you want to check on a feature in Python or a library module, you should have a very low threshold for quickly starting Eclipse and using its Python Interpeter, or writing a small script, to experiment. It is imperative that you get comfortable with this process immediately. |
Part C: Using the Debug Perspective |
In Part C you will read the document that is a tutorial about the
Eclipse Debug Perspective and use the debugger to answer a series of
seven questions about a program that plays the dice game craps.
So, you are not using the debugger to fix a incorrect program, but instead are
using it to monitor a correct program and get information about when
certain events happen in the program.
The debugger is a program that controls your program.
|
Part D: Test a Module/Class |
In Part D you will learn various ways to test Python code with the
driver.py module (which is in the courslib), concentrating on
how to write a testing file for use with this module's
batch_self_check function.
You will write such a file to test various factorial functions, and finally
submit this file on the Checkmate Homework Dropoff sytem.
Here is a checklist of things to do.
If you are confused or run into problems with any one, ask for help as soon as
possible.
We can call this function explicitly in the "interpreter", supplying it with the necessary arguments, but mostly we call it via the ! command (calling it with all default arguments) or the ? command (calling it with arguments entered by prompts to the user). The following paragraphs briefly describe how to write commands in a testing file; then you will be asked to write a testing file for the functions in the facts.py module. A testing file is a sequence of lines, each of which contains one testing command. The character(s) starting each testing command determines what is tested. Lines starting with # are special; they are comment lines; all other (non-blank) lines should start with a c, e, ^, or relational operator (==, !=, <, <=, >, >=, in, or not in). Each c command is followed by one operand; each e, ^, or relational operator is followed by two operands (which are each prefaced by a special separator string: the default separator value is -->).
IMPORTANT: Use the Eclipse editor to create/modify data files too, like the bsc.txt file. This is especially true if you are on a Mac. Do not use a Mac editor for data files.
|
Extra Credit |
Programming assignments must be turned in on time: you can get partial credit
for a partially completed assignment, but it must be turned in on time; I
will accept no late homework unless you have an official excuse pre-arranged
with me (and even then I will always want you to turn in whatever work you
have completed by the due date/time).
In fact, there is another incentive to finish not only on time, but to
finish early.
In all programming assignments, if you turn in everything at least 24 hours before it is officialy due, you will receive 1 point of extra credit. If you turn it in 48 hours (or earlier), you will receive 2 points of extra credit. (There is no more extra credit for early turn-ins; I recommend NOT turning it in more than 48 hours early.) This is equivalent to almost half a grade improvement (e.g., C+ to B, or B to B+, or B+ to A-) on a 50 point assignment. I expect most of the students to complete their assignments and submit them early, so they will receive some amount of extra credit; it adds up. There are two main advantages to planning on finishing early. First, if you run into a major problem, you will have extra time to solve it before the actual due date: and even experienced programmers frequently run into such problems. Yes, this means you! Second, and more importantly, if you are racing to finish before a deadline, stress levels can go through the roof, and you become less interested in learning the material (and the whole purpose of these programming assignments is to learn the material) and more interested in just getting finished before the deadline. If you do not learn the material, then you will be at a major disadvantage for subsequent programming assignments and tests, because of the cumulative nature of the material in this course. Therefore, work on an aggressive schedule and plan to finish every assignment by Sunday or Monday evening (or even earlier). Programming assignments sometimes also include an extra credit section worth 1 point. These are designed for students who finish early and want to continue exploring programming within the context of the assignment. The single point is to acknowledge, in a very small way, their extra effort. This assignment has no special extra-credit section. You can get extra credit on it only for an early dropoff. |
Time Management |
One of the hardest parts of being in college is learning how to manage your
time.
Time management is especially important in programming courses (and in the real
world, when you are working on complicated projects with hard deadlines).
The difference between good and bad time management can have a profound impact
on how much you learn in this course, how well you perform in it, how
much effort you actually need to expend to do well, and how you feel about
the course..
Most programming assignments can be broken into a series of smaller tasks, each that can serve as a milestone; when solved in sequence, these tasks will complete the entire assignment. Generally, it is best to spread out the work on a two-week assignment. Most assignmnts become available on Tuesday morning; I recommend reading the assignment before/during lab, so that if you are unsure about any parts of it, you can ask relevant questions about them on the Forum; this reading might include examining and understanding code provided in the writeup. You should start working on it during lab, and should plan to complete at least half the programming assignment by the next Tuesday lab. You should try to finish it by late the following the week: if not by Friday, you can work over the weekend to finish it. In a worst-case scenario you can use the lab on Tuesday to finish, asking final questions of the staff during that lab. Some students look at an assignment and think that it is best done in one sitting. If you can do so, great; but, if you plan to work this way, do the one sitting early, not the weekend before it is due. In this way, if you are wrong about the amount of time that it will take, you will still have adequate time to complete the assignment. Likewise, I have seen students who always spend Tuesday finishing the previous assignment, and not get around to looking at and starting the next one. This starts them on a bad path for finishing the next assignment. By meeting these time goals, you will both maximize what you learn and minimize your anxiety and the time that it takes for you to do the learning. Remember that assignments must be turned in on time: you can get partial credit for a partially completed assignment, but it must be turned in on time; I will accept no late homework unless you have an official excuse pre-arranged with me (and even then I will always want you to turn in whatever work you have completed by the due date/time). Finally, if you find yourself falling behind, seek help immediately (from me, the TA, the Lab Tutor, or even other students in the course - but only in ways that preserve academic integrity). When the real programs start, we will discuss in more detail what kind of help you can get legitimately, and what kind of help constitutes academic misconduct (cheating). |