### Class Programming Examples and Lecture Notes

Fall, 2007 -- Deena Engel - V22.0002.002 -- Send questions to

Class Date Topic
Class Programs
Class Lectures
1 09/04 Introduction to the class
welcome1

Introduction

2 09/06 Working with Java programs: welcome2; welcome3
Introduction to Java
Class: Discussion on Languages
(Nutshell): Introduction to Java (Sec. 1.1-1.2)
3 09/11 Visit to the ITS Lab; Assignment #0 - Worksheet due 09/18/07 Reading: Liang - Chapter 2
Class: Data Types
(Nutshell) Java Primitive Data Types: Sec. 2.3
4 09/13 Working with integers: writing a date
5 09/18 Working with doubles and problems with precision
Working with integers and longs
Assignment Operators
Math Operators: 1 and Math Operators: 2
6 09/20 Data Entry: Strings and integers
Using if/else: even and odd numbers; leap years
and checking the value of a number

Relational Operators
Reading: Liang Ed. 6: Chapter 3;
Liang Ed. 5: Chapter 3.1-3.2

7 09/25 Data Entry: characters
Switch statement
Selection Statements
8 09/27 More work with if/else and switch: days of the week
Concatenation: Example 1, Example 2, Example 3
Using Random Numbers to generate random numbers, random letters and "roll" a virtual die

Char datatype

Java in a Nutshell Section 2.4: Expressions & Operators

9 10/02 Music: Canon & Gigue by Johann Pchelbel (1653-1706) to illustrate iteration (repetition) in music... Pachelbel's Canon ... and on Electric Guitar
while loop ... using characters in a loop ... looping dice!
Reading: Ed. 6: Chapter 4; Ed 5: 3.3-3.6
Introduction to Loops
10 10/04 Art: An infinite Loop? (M. C. Escher: "Handteckning" [Drawing Hands], 1948; lithograph.)

Calculations with loops; how many times should the loop run? and using a sentinel

More on Loops
11 10/09 Decorative Arts: Reptition in the Grammar of Ornament, catalogued by Owen Jones (Dover Publications, NY, 1985) and catalogued digitally at the University of Wisconsin.
Looping through a String; converting to upper or lower-case and breaking up a String
Keywords break and continue

12 10/11 Working with Boolean variables and the conditional operator
Introducing do/while loops and a puzzle
Working with prime numbers
Prime Numbers Worksheet
13 10/16 Formatting numbers in output
Review:
We did various versions of both of these programs in class for review. Here are two examples; see if you can reproduce the others: working with loops; greatest common denominator

14 10/18 Midterm Exam #1 (in class)
15 10/23 for loops; using a for loop with a String and for exponentiation
Nested for loops: example 1, example 2, example 3
Introducing "for" loops
16 10/25

Art: Kilims (Lee Allane: "Kilims: A Buyer's Guide" , 1995; Thames & Hudson.) Plate 7 (contemporary; Iran) and Plate 14 (contemporary; Bulgaria) and a collection of Kilims from Turkey (Notice the repeated and "nested" patterns in the designs.)

Using "for" loops to write out a multiplication table

Java in a Nutshell: Summary of Statements 2.5-2.5.10
17 10/30 Music: Ravel's "Bolero" - on YouTube
Using methods: Repetition in "Green Eggs and Ham"; calculating squares - using methods
Reading: Ed. 6: Chapter 5; Ed 5: Chapter 4
Methods
18 11/01 More work with methods: squares, boxes, math methods Overview of Methods
Java in a Nutshell - 5th Edition - Section 6.2-6.2.1
20 11/08 Converting temperatures; random "words"; statistics
21 11/13 Class Review; See the Resources page for further problems
22 11/15 Midterm Exam #2 (in class)
23 11/20 Class cancelled Reading: Ed. 6: Chapter 6; Ed 5: Chapter 5
Arrays
11/22 No class ... Thanksgiving Holiday
24 11/27 Art: Sculptures by Louise Nevelson at the Guggenheim Museum and at the Whitney Museum
Arrays: using integers and characters
Java in a Nutshell - 5th Edition - Section 2.8.1 - 2.8.3.5
25 11/29 Array calculations and rolling a virtual die
26 12/04 Passing an array to a method; using an array of Strings and calling a program from a DOS prompt
Histogram - using an array to present data
multi-dimensional array

27 12/06 Arrays: More work with methods; copying arrays; copy-array utilities
Class Worksheet - using arrays as parameters with overloaded methods;
Applets
28 12/11 Review for the final exam

Final Exam: Thursday 12/20 8:00-9:50 AM