COMP114 Systematic Programming

Spring 2002

 

This course is intended for people who have learned to program.  Its goal is to teach how to program well.  The common programming strategy of beginners is to write a program and test it.  If tests show that a program doesn't work, then it is modified and re-tested repeatedly until the program (apparently) passes all the tests.   Even for simple programs and problems, this strategy has an obvious flaw because there is generally no sound basis for deciding that a program has been sufficiently well tested.  Another less obvious flaw is that for more complicated programs and problems, it may be difficult to determine whether the program has produced the correct answer for a test case because the computation is too long and tedious, and the programmer is unwilling or unable to carry it out independently.

 

This course is based on the belief that one can write better programs and produce a correct program more quickly by thinking carefully about what the program does, and how it works.  This requires that the programmer state the purpose of each program far more carefully than is easy or common, and make similar careful assertions about how the program works.  The claim is that, although your current strategy will produce a program faster, the strategy we advocate will produce a correct program faster.  The skills that will enable you to use this strategy form a large part of the challenge you face in this course.  I hope you will accept the challenge and replace the thrill of "It finally works for all my test cases!" with the thrill of "Now I understand how the problem should be solved, and my program implements that solution!" 

 

This deep understanding of the programming process will accompany and be applied to a number of other topics: data structures, abstract data structures, algorithms, and mathematical analysis techniques, all of which are fundamental to programming in languages such as Java or C++.  This is intended to be a hard course, and one that will introduce you to some of the ideas that can make programming a science.  We will be using Java for our programs.  Although it is assumed that you already know how to program, prior knowledge of Java is not essential.  If you have not used Java, you will have to work harder at the beginning of the course to learn it.

 

Instructor: Anselmo Lastra

Office: Sitterson 256

Office Hours: M 2-3, Th 2-3

Phone: 962-1958 (Please do not call me at home except in a dire emergency)

Email: lastra@cs.unc.edu

 

Teaching Assistants:

Scott Cooper, office Sitterson 045

Qiong Han, office Sitterson 036

Stephan Sherman, office Sitterson 036

Bingzhao Yang, office Sitterson 045

Office hours, email, and phone numbers will be on class web page soon.

 

Lectures: TTh 11:00-12:15 in CA111

Recitations:

               Section 601, Friday 2:00, SN011

               Section 602, Friday 3:00, SN014

               Section 603, Friday 1:00, SN011

               Section 604, Friday 4:00, SN014

 

Course Web Page: http://www.cs.unc.edu/~lastra/comp114. All course handouts will be available on the class web page.

 

Email: Send email to help114@cs.unc.edu to reach the instructors. Mail to comp114@cs.unc.edu goes to the whole class.

 

Textbook:

 

Mark Allen Weiss, Data Structures and Problem Solving Using Java

 

2ND Edition.

 

ISBN: 0201748355

Publisher: Addison Wesley Longman, Inc.

 

 

 

 

You will also need a Java reference if you do not have one.  The COMP 14 textbook (Lewis and Loftus, Java Software Solutions, 2nd edition, published by Addison-Wesley) is a good one.

 

Software: Microsoft Visual J++, version 6. You can get a free copy at the front desk in the Sitterson Hall upper lobby.

 

Grading:  Because this is a programming course, program assignments are required; unless all programs are submitted and work, you may not pass.  Given that all programs are submitted and work, final grades will be based on the following formula:

      10% Midterm exam #1

      10% Midterm exam #2

      20% Final Exam

      10% Written Assignments (maybe less than 10% if we have very few)

      50% Program Assignments

 

Examinations are closed book, notes and program listings; computers and collaboration are not allowed either.

 

The above percentages add up to 100%, but I reserve the right to apply a 10% fudge factor to give consideration to things such as good class participation, stellar programs, improving program scores over the semester, and bona fide extenuating circumstances. 

 

Point values of assignments and programs will be in accordance with their length and difficulty. Students are responsible for all material, including homework assignments, given in lecture or recitation classes.

 

The programs are expected to be 100% correct when turned in.

 

Incompletes. An incomplete will only be given for serious emergencies. Documentation (such as a physician’s note) is required.

 

What you should hand in for programs:  Each program submitted should consist of

 

a.       A labeled PC 3 1/2” disk containing your program and data.   The disk will be returned, but you should always keep an electronic backup copy of your programs.

      b.   A paper printout of your program (with pledge signed) and the set of test data.

 

Late Homework Policy:  Assignments are due at the beginning of class on each specified due date.  Programs and homework assignments will be penalized 25% if one class session late and 50% if two class sessions late.  No credit will be given for assignments submitted after the start of the second class period following the due date, although you are advised to submit work whenever it is finished.  It’s always better to hand in a program, even if it is very late, than to hand in nothing.

 

Making up homework and examinations:  Serious illness, a death in the family, and activities such as intramural meets and student exchange programs can justify waiving or relaxing the usual rules for class work and examinations.  But the vicissitudes of student life, including the consequences of procrastination and commitments to other courses, cannot.   In circumstances that merit special treatment, documentation is usually available to the student, and I feel most comfortable when a request for special consideration is accompanied by appropriate written material supporting the request.  In cases where events that will interfere with course work are foreseen, a student should discuss the matter with me well before the work is due.

 

Cooperation and Honor Code:

1.  You are encouraged and expected to discuss the material in class and all assignments among yourselves.

2.  You are permitted to discuss all aspects of the Java programming language with anyone.

3.  Keys for nearly all homework and programs will distributed about a week after the due date.  You are not permitted to use the homework or program keys from previous semesters, nor to share the ones received in this course with 114 students in future semesters.

4.  You are encouraged and permitted to discuss and cooperate on all written assignments, but you are expected to understand all material that you submit.  Examinations will consist primarily of material similar to that of the written assignments and programs.

5. You are encouraged to discuss all programming assignments, but not your solution to the later assignments.  Specifically,

a. To make learning Java easier, you are free to seek help from any source for the first two programming assignments (numbers 0 and 1).  The programs you hand in must be your own work, but they can be based on unlimited help in all aspects from any sources whatsoever.

b.      The rest of the programs are to be done independently by each student.  

For details on how the Honor Code applies to these programs, consult the handout 'Honor Code Observation in Computer Science Courses.'