### Course Lectures, Readings & Resources

Announcement:

• If you need help in this class, please see the tutors in the lab (see tutoring schedule and help page), email the etutor or come see me during my office hours. Good luck.
• Final Exam:Tuseday, 5/12, Time 2:00-3:50 PM, Room: 109 (40% of course grade)
* There will be no make up exams and the final is mandatory. Do not make plans to leave the New York City area before or on these dates

## Preparation for the final:

### Preparation for Midterm #1 review material

Here is a tentative schedule

Date

#### Class Lectures

1   Course Introduction

Course Introduction

2

Java Introduction
First programs: Welcome1, Welcome2 & Welcome3

Introduction to Java Lecture
3

Using "Variables": int, double, & float: addition

Arithmetic Operators: division, division2, average, the area of a circle

4

Data entry from the keyboard using JOptionpane class:Welcome3 and Welcome4, text, integers,

Mathematical operators Part 1

Mathematical operators part II

5

Using the"Mod" operator % to separate digits: DivMod.txt, ReverseDigits.txt, date

Using the"Mod" operator % to separate digits:

6

Using boolean data type: BoolTest.txt

Control Structure (comparisons):
Selection statements: if/else statements:
Even & odd numbers, comparing numbers

MORE EXAMPLES OF nested if statements and combining conditions : Bouncer1, Bouncer2, Bouncer3, Bouncer4, Bouncer5.txt, Bouncer6.txt, Bouncer7.txt, Bouncer8.txt,

Boolean types; If & else statements

7

UsingLogical operators "&&" , "||" and "^" : TruthTables
Using shortcut operators
( Conditional.txt)

Review if statements: dice_using_if

Switch selection: dice_using_switch ,switch example 2 ,

Data entry from the keyboard using JOptionpane class with char and String datatypes:text

Using Char: directions_using_if, directions_using_switch

Using length() to get the number of characters in the string: char using length

Conditions, logical operators, and switch statement
8

Casting IntLong.txt, Casting.txt, InaccurateDouble.txt

Shortcut operators: pre_post increment , Shortcut_operators

Formatting numbers for output

9

Char data type :char_entry, Char.txt, CharInput.txt,

Using length() to get the number of characters in the string: char using length

10

Repetition Structure: For loops

For loops: For1.txt, For2.txt, For3.txt

Using Counter controlled loops (for loops ): Alphabet.txt, String example,Sqaure numbers_ loop

** useful for homework ** For Loops with letters/string:
Converting Caps to small letters example
loop to count # of vowels
loop to count # of commas and spaces

11

While and for loops using numbers: while loops with numbers ,for loops with numbers , Sqaure numbers_ loop , product_loop

Using Sentinel value to control loops: Average , MaxNumber

Sentinels loops

12

Midterm #1 Review

3/12/09

Midterm # 1 Exam (20% of course grade)

Do while loops and nested loops are not included on the exam
14

do while loops

Do while example: DoWhileTest.txt, do-while example #2.

Using break and continue in loops: Using break and continue in a loop

15

Nested Loops examples: Nested loop using seconds and minutes, sec. min. and hours and days in one week ,

Nested loops

16

Review all of these examples for assignment #4:

1) Producing 2 D shapes using nested loops
Square_example, Rectangle
Triangles: right triangle1, triangle2, triangle3

2) More Nested loops examples:
multipication table1, Nested loops using multipication table2

3) Use nested loops to draw rugs pattern: pretty rug example 1, puzzle

Rug Art Example: viewing regular patterns in kilims from Iran and Bulgaria from Kilims: A Buyer's Guide by Lee Allane

17

More Nested Loops examples

Rug Art Example: viewing regular patterns in kilims from Iran and Bulgaria from Kilims: A Buyer's Guide by Lee Allane

More nested loops examples using rugs pattern: pretty rug example 1, puzzle

18

Methods

Methods in Java

19

Methods: Generating Random numbers:

Example of Math class Methods , Raise_to_Power

Example of Math class Methods

Generating random numbers lecture: Random

20

More example on generating random numbers with methods:

Generating random numbers and a range of random numbers
Generating random characters  and randomly rolling a die

example on generating random numbers with methods: random word(5 small letters)

Random method to generate different ranges of random numbers, Random method (interactive and effecient), random word(5 small letters)

21

Review Methods:Random numbers & user defined methods

SnakeEyes ,SnakeEyes using methods

Concepts: Scope (example 1) of local variables in Methods (pass by value)
Concepts: Scope (example 2) of local variables in Methods (pass by value)

Converting temperatures , Example of Math class Methods,Statistics, Boolean , Raise_to_Power,

BoxMethod (helpful for assignment # 5)

22

Examples of MAX methods with NO Overloading: max method with two parameters , max with three parameters

Examples of Overloading Methods(three methods with the same name in one class (program) with differnet number of paramters and different data types): three max methods in the same class

23

Midterm # 2 Review

24

Midterm # 2 Exam (20% of course grade)

25

Arrays: Sculptures by Louise Nevelson at the Guggenheim Museum

Chap. 6
Arrays lecture
26    Methods with arrays: PassArray , TestPassArray , Deviation , Copy array (refrence) , Copy array elements using a loop , Copy array elements using System.copyarray method

.