Instructor: Prof. Megan Owen
E-mail: megan.owen@lehman.cuny.edu
Phone: 718-960-7423
Office hours: Tuesday and Thursday, 2:40-4:10pm, Gillet 219 or Gillet 137E
Course time: Tuesdays and Thursdays 11:00am - 12:40pm, Gillet 219

Announcements:

Installing Eclipse and Java 8

These instructions are for downloading and installing Java 8, but if you already have an older version of Java installed on your computer, that should be fine to use. To install Eclipse on a Windows or Mac computer, you must first download and install Java 8 from Oracle. Make sure you download the Java Development Kit (JDK), not the Java Runtime Environment (JRE).

After installing Java, download Eclipse IDE for Java Developers (version 4.4. Luna) from eclipse.org. Make sure to download the correct version (32 or 64 bits) for your computer. If needed, use Google to find instructions for checking if your type of computer is 32 or 64 bits. If you have a Windows computer, there is a known problem with unzipping the files that is explained in the Download Eclipse section at http://wiki.eclipse.org/Eclipse/Installation.

Alternatively, Java and Eclipse are available on certain computers in the Academic IT Center and the math lab.

Link to extra help resources, practice problems, and old quizzes and exams

Textbook:

Introduction to Programming Using Java, Seventh Edition (Version 7.0, August 2014), by David Eck
Available online at: http://math.hws.edu/javanotes/

Other good free online textbooks on learning Java:

Think Java: How to think like a computer scientist, by Allen B. Downey
Available online at: http://www.greenteapress.com/thinkapjava/

Java for Python Programmers, by Bradley Miller
Avaiable online at: http://interactivepython.org/runestone/static/java4python/Java4Python.html (PDF)
This textbook is excellent for seeing how to convert loops and if statements from Python to Java, however, do not follow the author's example of using (wrapper) objects instead of primitive types in your Java code, because this can lead to performance issues.

Outline:

Date: Topics: Handouts/Homework: Slides/Reading: Deadlines:
#1
Thurs 29 January
Review of campus computer policy and academic integrity code.
Overview of Eclipse. Begin programming in Java! Data types, variables, Java conventions, assignment statements.
Syllabus Academic Integrity Policy,
1.3 Java virtual machine,
2.6.3 Eclipse,
2.1 The Basic Java Application (Hello world program),
2.2 Variables and the Primitive Types
#2
Tues 3 February
Type casting, keyboard and screen I/0 (Scanner), constants, math. Problem set 1 Chapter 2 slides,
2.4.6 Using Scanner for input,
2.3.1 Built-in Subroutines and Functions (math functions),
2.5.6 Assignment Operators and Type Conversion (type casting),
2.5.1 Arithmetic Operators (math operators),
2.5.2 Increment and Decrement (more math operators)
#3
Thurs 5 February
Strings Problem set 2 2.3.3 Operations on Strings Problem set 1 due Sat. Feb. 7
#4
Tues 10 February
If-else statements, boolean expressions, == vs. .equals() Problem set 3 Chapter 3 slides,
3.1.3 The Basic If Statement,
3.5 The if statement,
3.2 Algorithm Development,
2.5.3 Relational Operators,
2.5.4 Boolean Operators
Problem set 2 due Wed. Feb. 11
Thurs 12 February Lincoln's Birthday: No classes
#5
Tues 17 February
Conditional operator, exit, while loops, for loops Practice quiz 1 Problem set 4 Chapter 4 slides, 2.5.5 Conditional Operator,
System.exit (discussed in paragraph 3 of Section 2.3.1),
3.1.2 The Basic While Loop,
3.3.1 The while statement,
3.3.2 The do...while statement,
3.4 The for statement
Problem set 3 due Sat. Feb. 14Wed. Feb. 18
#6
Thurs 19 February
Loops cont'd, continue and breakQuiz 1 Problem set 5 Chapter 5 slides,
3.3.3 break and continue
Problem set 4 due Sat. Feb. 21
#7
Tues 24 February
Introduction to classes and objects: instance variables and constructorsPractice quiz 2 Problem set 6
Project 1
Chapter 6 slides,
5.1.1 Objects, Classes, and Instances,
5.1.2 Fundamentals of Objects,
5.2 Constructors and Object Initialization
Problem set 5 due Wed. Feb. 25
#8
Thurs 26 February
Classes and objects continued: toString() and non-static methodsQuiz 2 Problem set 7 5.3.2 The class "Object", including toString(),
5.6.1 The Special Variable this
Problem set 6 due Sat. Feb. 28
#9
Tues 3 March
Classes and objects continued: Getters (mutators) and setters (accessors) Practice quiz 3 Problem set 8 5.1.3 Getters and Setters Problem set 7 due Wed. March 4
#10
Thurs 5 March
Switch statement; classes and objects continued Quiz 3 Problem set 9 3.6 The switch statement Problem set 8 due Sat. March 7
#11
Tues 10 March
Classes and objects continued Practice quiz 4 Problem set 10 Problem set 9 due Wed. March 11
#12
Thurs 12 March
Arrays Quiz 4 Problem set 11 3.3 Introduction to Arrays,
7.1 Array Details,
7.2 Array Processing 7.5 Two-dimensional Arrays
Problem set 10 due Sat. March 14
#13
Tues 17 March
Selection Sort Practice quiz 5 Problem set 12 Chapter 7 slides,
7.4.4 Selection Sort
Problem set 11 due Wed. March 18
#14
Thurs 19 March
Selection sort cont'd, insertion sort, multidimensional arrays Quiz 5 7.4.3 Insertion Sort,
7.5 Two-dimensional Arrays
Problem set 12 due Sat. March 21
#15
Tues 24 March
Review for midterm
#16
Thurs 26 March
Midterm, Chapters 1-7
#17
Tues 31 March
Midterm recap, intro to project 2 Project 2
#18
Thurs 2 April
Inheritance Practice quiz 6 Problem set 13 Chapter 8 slides Chapter 8 Figures slides,
5.5 Inheritance, Polymorphism, and Abstract Classes,
5.6 this and super
3-11 April Spring recess: no classes
#19
Tues 14 April
Inheritance cont'd Quiz 6 Problem set 14 Problem set 13 due Wed. April 15
#20
Thurs 16 April
Interfaces Practice quiz 7 Problem set 15 5.7 Interfaces,
Lecture notes on Comparable interface and compareTo from the University of Washington
Problem set 14 due Sat. April 18
#21
Tues 21 April
Recursion: Merge sort Quiz 7 Problem set 16 Problem set 15 due Wed. April 22
#22
Thurs 23 April
Recursion: Binary search Practice quiz 8 Problem set 17 Chapter 11 slides,
Chapter 11 figures and listings,
9.1 Recursion,
9.2.1 Recursive linking
Problem set 16 due Sat. April 25
#23
Tues 28 April
Recursion: Fibonacci series and Factorials Quiz 8 Problem set 18 Problem set 17 due Wed. April 29
#24
Thurs 30 April
Recursion: Strings Practice quiz 9 Problem set 19 Problem set 18 due Sat. May 2
#25
Tues 5 May
Streams and File I/O (text files only) Quiz 9 Problem set 20 Chapter 10 slides,
Chapter 10 figures and listings,
11.2 Files,
11.3 Programming with Files
Problem set 19 due Wed. May 6
#26
Thurs 7 May
Exceptions Practice quiz 10 Chapter 9 slides,
Chapter 9 figures and listings,
3.7 Introduction to Exceptions and try..catch,
8.3 Exceptions and try..catch
Problem set 20 due Sat. May 9
#27
Tues 12 May
Exceptions continued, review for final exam Quiz 10
#28
Thurs 14 May
Review for final exam, Project 2 in-class code reviews Project 2 due
Thurs 21 May Final exam 11am - 1pm

Java resources: