600.107: Introduction to Programming
Summer Session 2006: May 30, 2006 - June 30, 2006
Contents
Catalog Description:
An introduction to computer programming fundamentals using
Java.
Course focuses on principles of developing well-designed programs
for immediate use while providing a solid foundation for more
advanced object-oriented programming.
Topics include variables, control structures, basic data
structures, methods, class design, and others as time permits.
Course homework involves significant programming (15-20 hours/week).
Prerequisite(s):
Familiarity with using computers;
600.101: Computer Fluency
or
600.102: Foundations of Computer Science
could be helpful.
Academic Honesty:
It is your responsibility to adhere to the
Department
Integrity Code and other applicable university regulations.
Feel free to
email us
your questions or concerns.
Discussion List:
cs107-discuss@bloat.org
(open discussion, but you must subscribe
here
first)
Staff List:
cs107-staff@bloat.org
(to contact all of us, but only staff can subscribe)
Submit Assignment:
cs107-submit@bloat.org
(we grade your last submission
before the deadline)
Lecture:
Monday, Wednesday, Friday: noon - 2:30 pm
Location:
2
Shaffer Hall
Instructor:
Peter Fröhlich
Office Hours:
Monday, Wednesday, Friday, 3:00 pm - 4:00 pm
Location:
326 New Engineering Building
Teaching Assistant:
Kartik Trehan
Office Hours:
Tuesday, Thursday, 6:00 pm - 7:00 pm
Location:
160
Krieger Hall
(aka "haclab")
Here are some important notes to keep in mind while reading the
schedule and preparing for the course.
If you have any questions or concerns, please don't hesitate to
ask!
-
The schedule outlined here is tentative for
a variety of reasons including, but not limited to, the
following:
-
First, I have never taught this course before,
so my estimates for how long things will take are probably all
wrong.
-
Second, and conceivably unrelated to the first reason, you may
find certain concepts harder or easier to grasp than I expect;
that will prompt me to slow down or speed up
as necessary, possibly even adding or skipping material.
-
Third, you may convince me that certain topics I have planned
are boring and that you would rather learn
about something else; if you have serious
suggestions for more interesting topics, I am certainly willing
to consider them.
-
Stuff listed in bold indicates a due date of some sort,
attached to a grade item that will influence your final grade.
See Assessment for more details.
-
Note that there are only 14 class meetings
for this course during summer session.
We will move very quickly compared to the
regular, semester-long course.
You must keep up with your readings and
assignments to succeed.
-
Since 2.5 hours of continuous lecture with me droning on and
on about something would be horrible beyond
description, we'll do a variety of things in
class and take regular breaks.
-
Office hours are your friend! We don't reserve time for sitting
around and twiddling our thumbs... Please take advantage of this
extra opportunity to get help with the material (or just to hang
out and discuss the world at large).
-
About the lecture notes: I want you to send me whatever you wrote
down during lecture. On the day you volunteer, it would be nice if
you kept your notes a little more detailed than you might otherwise
though. Send your notes to me as a plain text file, not Word or PDF
or HTML or anything fancy. It would be nice if you converted pictures
to "ASCII Art" as well, but you don't have to. Also, you can send a
"fancy" version in addition to the plain text version if you prefer
that. I will combine the two versions I get and edit them somewhat.
Note that this is a pretty time-consuming process, so the edited
notes will not always be available the next day.
-
About the logs: I want you to "reflect" on what you have learned
and done for the course each week. You should focus on the concepts
you tried to grasp and how that went, the assignments you tried to
do, and how those went, etc. Any kind of "reflection" on the course
is a valid log, you just have to show me that you put some effort
into writing it. So please don't send me two disconnected sentences.
Also, I want you to keep updating the same document, so the log
should "grow" over time and you're free to change earlier entries
to reflect later understanding. As with everything else, this should
just be plain text, not Word or PDF or HTML or anything fancy.
-
About "Programming Style" and "Documentation": I noticed that some
of you hand in seriously ugly code. That was okay for the first two
assignments, but things should be getting better. Just for reference,
here's a short list of the minimum requirements we
look for:
-
Indent your code consistently using 2-4 spaces
(not tabulators) for each nesting level; where you put braces is
really up to you, just put them consistently as
well. And please always put braces as part of
instructions like
if and while.
-
Follow the standard conventions for identifiers:
packages are
all.lower.case,
classes are MixedUpperCase and start with upper case,
variables, functions, and procedures are mixedUpperCase
but start with lower case,
constants are ALL_CAPS with underscores if needed;
functions often (but not always) start with adjectives,
procedures often (but not always) start with verbs. Also, the
larger the scope of an identifier, the longer
and more descriptive it should be; using i inside
a procedure is fine, using i inside a class is
not a good idea.
-
Don't compare
boolean expressions to true
or false: They are boolean already,
no additional comparison needed, ever.
-
Once
javadoc is introduced, have at least
one comment for each class or interface and one comment for each
method. Follow the usual guidelines for writing these. They don't
have to be essays but should be complete enough and clearly worded.
Comments inside your code should add information
to the code, not repeat obvious things. Consider a comment for the
purpose of each variable as well, the larger the scope of a variable
is the more important such a comment about will be. And don't
contradict your code!
I plan to expand this into a longer document some time soon, but for
now this will do, and I hope considerably improve your programming
style. I'll try to add regular "style critiques" to lecture as well. :-)
Week 1: May 30 - June 4
Wednesday, May 31:
-
Lecture:
- Welcome to "Introduction to Programming (in Java)"
- The "Computer Science" Misnomer and Other Inconvenient Truths
- Theory: Languages, Programs, and Machines
- Java: A View from 9,144 Meters
- Practice: Hardware, Software, Compilers, Interpreters
- Theory: Instructions and Expressions
- Java: Cryptic Incantations and Printing Stuff
- Theory: Values, Types, Operations
- Java: Integers, Floats, Characters, Booleans, Strings, Overloading
-
Reading:
-
Tasks:
-
Sign up for the course discussion mailing list
and introduce yourself (again).
-
Submit your lecture notes for today if it is
your turn to do so.
-
Grab Assignment 0
and get started.
Friday, June 2:
-
Lecture:
- Questions on Assignment 0
- Questions on Chapters 1 and 2
- Java: Precedence, Associativity, Coercion, Casting
- Discussion of the Dijkstra paper
- Dijkstra's Pebble Game
- Theory: State and Variables
- Java: Variables and Assignments
- Theory: Conditionals and Repetitions
- Java: if and while
- Java: Implementing the Pebble Game
-
Reading:
-
Tasks:
-
Submit Assignment 0
before lecture today!
-
Submit your lecture notes for today if it is
your turn to do so.
-
Grab Assignment 1
and get started.
Sunday, June 4:
-
Tasks:
-
Submit your initial log for the first week.
Week 2: June 5 - June 11
Monday, June 5:
-
Lecture:
- Questions on Assignment 1
- Questions on Chapters 3, 4, and 5
- Discussion of the Graham paper
- Java: Using final for Variables
- Java: Implementing the Gravity Problem
- Theory: Roles of Variables
- Theory: Characterizing State
- Java: assert
-
Reading:
-
Tasks:
-
Submit Assignment 1
before lecture today!
-
Submit your lecture notes for today if it is
your turn to do so.
-
Grab Assignment 2
and get started.
Wednesday, June 7:
-
Lecture:
- Questions on Assignment 2
- Questions on Chapters 1-5 or other readings
- First Exam! (Sample Solution)
- Questions on the exam
- Discussion of the Knuth paper
- Theory: Procedures and Functions
- Java: static methods
-
Reading:
-
Tasks:
-
Submit Assignment 2
before lecture today!
-
Submit your lecture notes for today if it is
your turn to do so.
-
Grab Assignment 3
and get started.
Friday, June 9:
-
Lecture:
- Questions on Assignment 3
- Questions on Chapter 7
- Discussion of the Wing paper
- Java: Scopes and The Evils of Global Variables
- Theory: Recursive Definitions and Processes
- Java: Writing Recursive Methods
- Java: Documentation and the
javadoc tool
- Java: Critique for Assignment 3
-
Reading:
-
Tasks:
-
Submit Assignment 3
before lecture today!
-
Submit your lecture notes for today if it is
your turn to do so.
-
Grab Assignment 4
and get started.
Sunday, June 11:
-
Tasks:
-
Submit your updated log for the second week.
Week 3: June 12 - June 18
Monday, June 12:
-
Lecture:
- Questions on Assignment 4
- Questions on Chapters 7 and 14
- Theory: Specification of Functions and Procedures
- Java: Using
assert for Pre- and Postconditions
- Theory: Reference Types and the Notion of Equality
- Java:
String as a Reference Type
- Theory: Classes, Objects, Methods, and Messages
- Theory: Arrays or "Bunches of Variables"
- Java: Working with Arrays
-
Reading:
-
Tasks:
-
Submit Assignment 4
before lecture today!
-
Submit your lecture notes for today if it is
your turn to do so.
-
Grab Assignment 5
and get started.
Wednesday, June 14:
-
Lecture:
- Questions on Assignment 5
- Questions on Chapters 3, 9, and 10
- Java: Array Declarations
- Java: Hacking the
Freq.java problem in painstaking detail!
- Java: for-each loops
-
Reading:
-
Tasks:
-
Submit Assignment 5
before lecture today!
-
Submit your lecture notes for today if it is
your turn to do so.
-
Grab Assignment 6
and get started.
Friday, June 16:
-
Lecture:
- Questions on Assignment 6
- Questions on Chapters 3, 9, and 10
- Discussion of the Harris interviews
- Java: Varargs and why they are convenient
- Java: Arrays with more than one dimension
- Theory: Problems of Time, Space, and Power
- Theory: Linear Search and Binary Search
- Theory: Records for Structured Data
- Java: Using Classes as Records
-
Reading:
-
Tasks:
-
Submit Assignment 6
before lecture today!
-
Submit your lecture notes for today if it is
your turn to do so.
-
Grab Assignment 7
and get started.
Sunday, June 18:
-
Tasks:
-
Submit your updated log for the third week.
Week 4: June 19 - June 25
Monday, June 19:
-
Lecture:
- Questions on Assignment 7
- Questions on Chapters 8 and 10
- Second Exam! (Sample Solution)
- Questions on the exam
- Discussion of the Steele paper
- Discussion of Peter's new
Freq program
- Theory: Records + Methods = Classes
- Java: Adding
toString and equals
- Java: Adding constructors to initialize objects
-
Reading:
-
Malik:
Chapter 8 (User-Defined Classes and ADTs),
Chapter 11 (Inheritance and Polymorphism; just skim this one to
get an idea of what this stuff is ahead of lecture)
-
Tasks:
-
Submit Assignment 7
before lecture today!
-
Submit your lecture notes for today if it is
your turn to do so.
-
Grab Assignment 8
and get started.
Wednesday, June 21:
-
Lecture:
- Questions on Assignment 8
- Questions on Chapters 8 and 11
- Background on Object-Oriented Programming
- From Problem Statements to Code: Abbot's Method
- Example of using Abbot's Method for Freq
- Java: Refactoring Freq to an Object-Oriented Design in painstaking detail!
- Java: Using
this and private
-
Reading:
-
Tasks:
-
Submit Assignment 8
before lecture today!
-
Submit your lecture notes for today if it is
your turn to do so.
-
Grab Assignment 9
and get started.
Friday, June 23:
-
Lecture:
-
Andreas Terzis:
Life Under your Feet: A Wireless Soil Ecology Sensor Network
(Guest Speaker)
- Questions on Assignment 9
- Questions on Chapters 8 and 11
- Theory: Sorting Problems, Selection Sort
- Theory: Intractable Problems, Traveling Salesperson Problem (TSP)
- Theory: Graphs and Adjacency Matrices
- Theory: Using Genetic Algorithms to "Solve" TSP
-
Reading:
-
Malik:
Chapter 8 (User-Defined Classes and ADTs),
Chapter 11 (Inheritance and Polymorphism)
-
Optional:
Whatever you can find regarding Genetic Algorithms
and the Traveling Salesperson Problem.
Cite your sources! Don't steal code!
-
Tasks:
-
Submit Assignment 9
before lecture today!
-
Submit your lecture notes for today if it is
your turn to do so.
-
Grab Assignment 10
and get started.
Sunday, June 25:
-
Tasks:
-
Submit your updated log for the fourth week.
Week 5: June 26 - June 30
Monday, June 26:
-
Lecture:
-
Reading:
-
Malik:
Chapter 8 (User-Defined Classes and ADTs),
Chapter 11 (Inheritance and Polymorphism)
-
Tasks:
-
Submit Assignment 10
before lecture today!
-
Submit your lecture notes for today if it is
your turn to do so.
Wednesday, June 28:
-
Lecture:
- More on Inheritance and Subtyping
-
Jason Eisner:
Natural Language Processing
(Guest Speaker)
-
Reading:
-
Malik:
Chapter 8 (User-Defined Classes and ADTs),
Chapter 11 (Inheritance and Polymorphism)
-
Tasks:
-
Submit your lecture notes for today if it is
your turn to do so.
Friday, June 30:
-
Lecture:
- Questions on anything for the exam
- Third Exam!
- Questions on the exam
- Course Retrospective and Wrapup
-
Reading:
-
Tasks:
-
Submit your lecture notes for today if it is
your turn to do so.
-
Submit your updated log for the fifth week. Feel free to include
feedback on the course as a whole.
Text Books
Let's start with the official stuff. The following
book is required for the course.
The schedule lists assigned readings from it which may show up on
assignments and exams.
We also reserve some time for discussing these readings in lecture.
Davender S. Malik:
Java
Programming: From Problem Analysis to Program Design,
2nd Edition, Thomson Course Technology, 2005.
[Buy]
That said, I have to admit that I did not hear anything particularly
good about this book from students. I think it's an okay book, but I
am not a beginning Java programmer myself, so it's somewhat hard to
judge how well the book does its job. I have, however, heard good
things about the following book.
Kathy Sierra,
Bert Bates:
Head First Java,
2nd Edition, O'Reilly, 2005.
[Buy]
The problems with this one: I have not had a chance to read it myself.
It's unlikely to become the "required" text since it's (by definition)
not a "regular" text book. It may make programming too much fun. :-)
Of course these two are not the only options, here's a popular (but
slightly outdated) text that's freely available online; there's also
a shiny new 4th edition you have to buy on paper.
Bruce Eckel:
Thinking in Java,
3rd edition, Prentice Hall, 2003.
[Buy]
Sun also entered the fray at some point by putting together the
following (pretty outdated but continually updated) tutorial, again
freely available online. I like the "trails" structure a lot, but I
have not used it extensively myself.
Mary Campione, Kathy Walrath, Alison Huml:
The Java Tutorial,
3rd edition, Addison-Wesley, 2000.
[Buy]
If you have looked at all of these and still don't like any of them,
then you are of course free to choose whatever other Java text you
feel like.
However, the assigned readings will still be based on Malik for
consistency with other offerings of this course...
Reference Books
Text books are supposed to help you learn the
basics, reference books are supposed to help you work
once you know the basics.
There are a number of good reference books for Java, and you may want
to grab one of these for the later parts of the course.
However, the online documentation from Sun is also pretty good, so none
of these are required.
This first reference book is probably the most useful for general
Java hacking.
David Flanagan:
Java in a Nutshell,
5th edition, O'Reilly, 2005.
[Buy]
The official language specification for Java is a good
resource to have around, but you can easily access it
online, no need to shell out money.
James Gosling,
Bill Joy,
Guy L. Steele Jr.,
Gilad Bracha:
The Java Language Specification,
3rd edition, Addison-Wesley, 2005.
[Buy]
I don't like huge books at all, so the following is a dream-come-true
for me. If you want a really concise reference on
Java as well as the basic parts of the Java library,
this one actually fits into the proverbial nutshell.
Warning: Sometimes you need to read a page 3 times before you get it,
that's how concise this thing is. :-)
Peter Sestoft:
Java Precisely,
MIT Press, 2nd edition, 2005.
[Buy]
There are probably many other useful reference books for Java, so if
you think I missed a good one, please let me know and I'll add it here.
Other Books
Enter any book store and you'll find loads
of books related to programming in general and to Java in
particular. The "gems" are hard to find among the flood of
mediocre stuff, so I decided to make some (personal?)
recommendations.
First, here is a concise summary
of good Java programming style,
inspired by the
well-known classic
on good English writing style.
Al Vermeulen et.al.:
The Elements of Java Style,
Cambridge University Press, 2000.
[Buy]
If you are bored with everything we do in class, and
especially if you think you know everything
about Java already, this book serves up a whole menu of
brain teasers for even the most hardened Java hacker.
Joshua Bloch, Neal Gafter:
Java Puzzlers: Traps, Pitfalls, and Corner Cases,
Addison-Wesley, 2005.
[Buy]
Finally, here's a collection of very good
advanced Java advice, following in the footsteps of a
famous series of C++ books.
If you want to take your Java skills to the next level after this
course, you'll have to get this one.
Joshua Bloch:
Effective Java Programming Language Guide,
Addison-Wesley, 2001.
[Buy]
There are probably many other useful books about programming and Java,
so if you think I missed a good one, please let me know and I'll add
it here.
Online Stuff
Development Environments:
-
Sun Microsystems:
Java Development Kit,
the core stuff you need to write Java programs
-
jGRASP
Integrated Development Environment (IDE),
for beginners and used in other offerings of this course
-
BlueJ
Integrated Development Environment (IDE),
another one for beginners
-
Eclipse
Integrated Development Environment (IDE),
for professionals, can't hurt to learn this if you plan to do
serious Java hacking in the future
Java Documentation:
Other Courses:
If you find other online resources that are helpful to you, please let
me know so I can add them here. Thanks!
Previous Offerings
Assignments (about 13): 50%
Exams (exactly 3): 40%
Participation (unknown number): 10%
Important Notes
Assignments are due when indicated on the
Schedule,
late assignments are not accepted.
Not ever!
Since assignments may be graded automatically it is
important that you follow our instructions exactly
as specified.
If your solution to a programming assignment does not
compile, you will get no credit for your solution.
If your solution to a written assignment contains too many spelling
errors, you wil get no credit for your solution.
Starting assignments as soon as they are out is
highly recommended, submitting
assignments early is encouraged
as well.
Exams are cumulative, closed-book, closed-notes, open-mind and cover
material from assignments, lectures, and readings.
You are allowed to bring a cheat-sheet
that must be handed in with the test.
The cheat-sheet must be in your hand-writing and
must clearly indicate your name and email address.
The cheat-sheet is at most one 8.5" by 11" page
with notes on both sides.
Participation covers all kinds of stuff including
(but not limited to)
attending lectures,
doing in-class exercises,
taking part in discussions,
helping others (without cheating of course!)
in class and on the discussion list,
keeping your log up-to-date,
writing lecture notes,
etc.
Final Grade
Each grade item is measured as a percentage relative to the highest
actually achieved score for that item.
Grade items in each category (Assignments, Exams, Participation) are
averaged, multiplied by the weight of their category, and added
together to yield your final percentage score in the course.
Your final grade is determined according to the following scale:
100-90: "A", 89-80: "B", 79-70: "C", 69-60: "D", 59-0: "F".
Plus and minus grades fall at the extreme ends
of these ranges, for example 89 is a "B+" grade but 88 is a "B"
grade.
There is no curve!
There are no "I" grades either!
Updated:
$Id: index.html 254 2006-06-29 13:01:43Z phf $
Validate:
XHTML
CSS
Copyright © 2006
Peter H. Fröhlich.
All rights reserved.