CS 151 A/B - Fall 2007

Structured Programming and Elementary Algorithms

(How to get a computer to follow your instructions)
Syllabus

Course Description

The purpose of this course is to teach you how to program a computer to solve problems and do interesting things for you.  We will do this using the Java programming language.  Why would you ever need or want to do this?  You all probably know how to use a computer to send e-mail, browse the World Wide Web, write a document, and do some other things with varying levels of expertise.  When you encounter something you want to do via computer that cannot be done using the applications you already know, you just look for another application, right?  If you are lucky, you can find such an application, and if you are really lucky, it might even be free.  Unfortunately, this is often not the case, especially when it comes to solving more complicated or specialized problems.  Hence, it is useful to be able to write your own software and tell the computer how you want your problem solved.  Knowing something about how to program a computer will also give you a greater appreciation for the applications you use and help you better understand the new applications you have to learn down the road.

This course assumes only basic familiarity with a computer.  In addition to CS majors and minors, anyone interested in learning about how to create computer software are welcome to join.  If you have a desire to learn, are willing to do so through trial and error, and are reasonably persistent, I am confident you will find the course challenging and rewarding.

Instructor

Scott Russell
Mudd 416A
srussell@colby.edu
(207) 859-5855

Office hours: Mon. 1-3 pm, Thurs. 10 am-noon, and by appointment
You are welcome to drop by my office at any time for help.  However, if I am busy with something else, I may ask you to come back at a more convenient time.

Text and Other References

The book we will use is Java Concepts for Java 5 and 6, 5th Edition by Cay S. Horstmann.  You should find the book at the college bookstore.  Where you choose to buy it there or elsewhere is up to you, but please do buy a copy of the book.  Please always bring your book with you to lab.  Additional content for the book can be found on the Web at http://www.wiley.com/college/horstmann.  There are numerous other books about Java out there as well as a plethora of on-line content about programming in Java.  Feel free to consult these if you find them helpful.  Language specific documentation for Java 1.5.0 can be found at http://java.sun.com/j2se/1.5.0/docs/api/index.html. There are also tutorials other potentially useful resources at the same site (http://java.sun.com).

Project and Grade Statistics

Tentative Schedule

This will change as the semester goes on, but it should give you some idea of where we are heading.

Week

Date

Topic

1

3-Sep

Labor Day (no class)

 

5-Sep

course admin., about me, computers, programming languages, and problem solving (1.1-1.4)
Files (.zip) for Lab #1 files

 

7-Sep

Compiling programs, calling object methods (1.6-1.8, 2.1)

2

10-Sep

variables: types & assignment; Objects, classes, methods (2.1-2-.3)
Programming Project #1 (Due Mon., 9/17/07 by 23:59:59:999 EDT)
Project #1 Solution

 

12-Sep

All about methods, numeric types, constructing simple objects (2.4-2.6)

Instructions for Lab #2

 

14-Sep

Review & assimilate concepts, lab solution, accessor & mutator methods (2.7)

3

17-Sep

class interface specification, instance variables, and documentation (3.1 -3-4), PlayingCard class example

Instructions for Lab #3


Solution 1 for Lab #3
Solution 2 (using get/set and this) for Lab #3

 

19-Sep

PlayingCard example continued; instance fields, constructors, methods (3.4-3.5)

Programming Project #2 (Due Fri., 9/28/07 by 23:59:59:999 EDT)

Project #2 Solution

 

21-Sep

Lab recap, using get() and set() methods, class testing (3.4-3.6)

4

24-Sep

PlayingCardDeck, constants, categories of variables (3.7-3.8)

 

26-Sep

Binary counting, fundamental types and arithmetic, static methods, Math class (4.1-4.5)

Instructions for Lab #4
Solution for Lab #4

 

28-Sep

Lab recap, assimilate concepts, variable scope, string manipulation, (4.5-4.6)

5

1-Oct

Conditional logic and flow control using Automobile class (5.1-5.2)

Programming Project #3 (Due Mon., 10/8/07 by 23:59:59:999 EDT)

Project #3 Solution

 

3-Oct

Sequential and nested comparisons, Boolean operators logic and expressions (5.3-5.4)

Instructions for Lab #5

Solution for Lab #5 (drive2 implements step 12 & 13 but hasn't been tested)

 

5-Oct

Lab review, nest if loops, string comparisons, Boolean expressions null testing (5.3-5.5)

6

8-Oct

while and for loops, while version of encryption method (6.1-6.2)

 

10-Oct

Loan calculator, while loops continued, Scanner class, Logger (4.7, 6.1-6.2)

Instructions for Lab #6

 

Lab #6 Solution: CSMath class and CSMathApplication class

 

Programming Project #4 (EXTENDED AGAIN Due Thurs., 10/25/2007 by 23:59:59:999 EDT)

 

Project #4 Solution

 

11-Oct

Review session 7:30 -9 p.m., Keyes 102 (5 attended)

 

12-Oct

Nested for loops, exam coverage and questions (6.3-6.5)

7

15-Oct

Midterm Exam (in class)

Question #9 and Domino class solutions

 

17-Oct

Return and go over midterm?

Debugging (6.6-6.7)

Instructions for Lab #7

Solution for Lab #7

 

19-Oct

Project #4 questions

 (drop deadline)

8

22-Oct

Fall Break (no class)

 

24-Oct

Arrays and ArrayLists (7.1-7.2)

Instructions for Lab #8

Solution for Lab #8

 

26-Oct

Arrays and ArrayLists (7.1-7.4)

Proj. 5 demo.

Programming Project #5 (Due Fri., 11/9/2007 by 23:59:59:999 EST)

Project #5 Solution

9

29-Oct

Arrays and ArrayLists (7.5-7.8)

 

31-Oct

Min, max, median, Arrays to ArrayLists

Instructions for Lab #9

Solution for Lab #9

 

2-Nov

Insertion Sort, Inheritance (10.1)

10

5-Nov

Inheritance (10.1-10.4)

 

7-Nov

Inheritance (10.4-10.8)

Instructions for Lab #10

Solution for Lab #10

 

9-Nov

Inheritance, Input/Output (11.1-11.2)
Proj. 6 demo.
Programming Project #6 (Due Tues., 11/20/2007 by 23:59:59:999 EST)

11

12-Nov

Overriding toString(), and other inheritance miscellany

 

14-Nov

2-D Array review & Reading File Input (11.1 – 11.4)

Instructions for Lab #11

Solution for Lab #11

 

16-Nov

Reading & Writing files/Exception Handling (11.1 - 11.5)

12

19-Nov

Exception Handling

 

21-Nov

Thanksgiving (no class)

 

23-Nov

Thanksgiving (no class)

13

26-Nov

Finish Exeception Handling

Programming Project #7 (Due Fri., 12/14/2007 by 23:59:59:999 EST)

 

28-Nov

Recursion (13.1 - 13.2)
Instructions for Lab #12
Solution for Lab #12

 

30-Nov

Lab solution, Proj. 7 ideas, GetInt.java

14

3-Dec

Recursion (13.1 – 13.4)

 

5-Dec

All College Course Evaluations
Merge Sort (14.4) ?
Instructions for Lab #13
Solution for Lab #13

 

7-Dec

Dept. Course Evaluations, wrap-up, parting wisdom, final coverage, Search.java

 

 

 

 

14-Dec
(Friday)

Project 7 due by 23:59:59:999 EST

EXAM
# 12

15-Dec
Saturday

FINAL EXAMINATION: 3:30 – 5:30 p.m. in Olin 001


The exam will cover all material from lectures and lab and chapters 1, 2.1-2.10, 3.1-3.8, 4, 5, 6, 7, 10.1-10.8, 11, 13.1-13.3, 14.7 from the textbook.

Meeting and Communication

The course web page (including this syllabus) is located at http://cs.colby.edu/cs/srussell/cs151.  I will post programming project assignments and other important course related information there, so please check in periodically. I have also created a mailing list called cs151 to help us communicate with each other.  I will use it to send out class related announcements, clarify questions, and so on.  You are all encouraged to utilize the list to answer one another’s questions, arrange study groups, and interact as you see fit.  Please add yourself to this mailing list as soon as possible by visiting http://mailmanbox.colby.edu/mailman/listinfo/cs151.

 

Section

Type

Days

Time

Bldg/Room

CS151A

Lecture

-M-W-F-

10:00-10:50 am

OLIN 234

CS151B

Lecture

-M-W-F-

11:00-11:50 am

OLIN 234

CS151B1

Lab

----R--

1:00- 2:20 pm

OLIN 323

CS151B2

Lab

----R--

2:30- 3:50 pm

OLIN 323

CS151A1

Lab

---W---

1:00- 2:20 pm

OLIN 323

CS151A2

Lab

---W---

2:30- 3:50 pm

OLIN 323

 

Attendance Policy

You are expected to attend all lectures and labs and actively participate in them.  You will benefit from what is said and happens in lecture and lab, whereas we will enjoy the pleasure of your company and benefit from your insights.  I will cover the same material in both lecture sections.  If for some reason you cannot come to lecture, you are responsible for finding out what was covered (preferably from one of your classmates).  In the event that there are not enough seats because some people are visiting from the other section, anyone not registered for that section might be asked to stand or sit on the floor.  This is not to punish you for attending the wrong section, but simply a courtesy to your classmates who are attending their registered section. While I will not record attendance, I do reserve the right to use my sense of your attendance and participation to decide grades that fall on a boundary, e.g. to decide if you get a B+ or an A- when your grade falls between the two.

Assignments, Tests, and Grading

There will be approximately 8 programming assignments/projects during the semester.  This may seem excessive, but the best way to learn to program is by doing it.  You will always have at least a week to complete an assignment and longer for more involved assignments.  All assignments are due by midnight on the due date unless otherwise specified and will be submitted electronically.  I will tell you more about the details of electronic submission when the time comes (by which time the process should be finalized).  No late assignments will be accepted.  It is your responsibility to budget your time accordingly so that you can complete the assignment by the due date.  The only exceptions to this policy will be for serious illness (for instance requiring hospitalization) or a family emergency and will be made at my discretion. 

 

These assignments will count for 60% of your total grade. They will be graded primarily in terms of completeness and correctness.  Please be sure to implement all functionality specified in the assignment and make certain that any files you submit compile without errors.  Secondary grading considerations will include style and suitable documentation.  Again, more about this when I hand out your first assignment.

 

There will be a midterm and a final examination each worth 20% of your grade.  The midterm date is tentatively scheduled for 10/15.  I intend to finalize this date within the first week of classes.

 

I reserve the right to deviate from this formula by minor amounts in unusual cases.  If for some reason I decide to change these percentages, I will so do only after informing you.

Collaboration

·       You are strongly encouraged to collaborate with one another to learn the material presented in lecture and lab.

·       A certain amount of collaboration is allowed on programming assignments:

1.     You may discuss the general aspects of the assignment with any member of the class (and of course me) in order to resolve ambiguities about what is required. 

2.     You may brainstorm general approaches to the assignment only with other members of the class.

3.     You may get help from lab tutors and others outside of this class to resolve specific syntax errors in your code only after having spent a reasonable amount of time trying to find the problem yourself.

4.     You should not discuss specifics of your solution to the assignment or share any of the code you write to implement your solution with any member of the class or anyone outside the class. 

5.     You should not seek solutions to the assignment in other books or anywhere on-line.  You may of course consult on-line documentation and other approved resources.

6.     If at any time you are in doubt, please ask me before doing something that may violate this policy.

7.     Cite any sources that you feel were particularly helpful within the above guidelines.
 

·       Absolutely no collaboration is permitted on examinations.

Academic Dishonesty

Any violations of the collaboration policy should be acknowledged promptly in person and will be dealt with on a case-by-case basis.  Unacknowledged violations of the collaboration policy, acts of deliberate plagiarism, or any other forms of cheating are a serious matter.  The first offense will result in a zero grade for the assignment in question.  A second offense will result in your dismissal from the course with a grade of F, and your conduct will be reported to the Dean of Students.

(The format and organization of this syllabus was borrowed from Prof. Leo Reyzin.  Thanks Leo!)