Introduction to Computers and Programming: V22.0002

Class Programming Examples and Lecture Notes

Section 3 (Tuesdays & Thursdays 8:00-9:15 AM, Room 101) - Deena Engel

Important Note: All of the PowerPoint Slides listed below are adapted from Prentice Hall's resources for the textbook, Introduction to Java Programming 4E by Y. Daniel Liang and are copyright protected.

  1. Homework Assignments
  2. Solutions to Midterm #1
  3. Solutions to Midterm #2
  4. Sample Department Final and Solutions

December 9, 2003: In-class exercise: using an array and a sentinel

December 4, 2003: In-class exercise: Perfect Numbers; (Optional Material) Applets

December 2, 2003: In-Class Exercise onHistograms; Linear Search; Bubble Sort; Selection Sort

November 25, 2003: TestCopyArray, Overloading methods using arrays: Deviation, PassingArraysToMethods

November 20, 2003: Further work with Arrays InClassExercise, RollDiceWithArrays
Passing arrays to methods: TestPassArray, PassArray2

November 18, 2003: Arrays TestArray

November 13, 2003: Introducing arrays array1, array2, array3, array4, array5

November 6, 2003: More work with Methods: OverloadingMethods, TempConversions, RandomWords, ComputeStatistics

November 4, 2003: More work with Methods FactorialMethods, RaiseToPowerMethod, ScopeDemo, SnakeEyes

October 30, 2003: Terms & Definitions, Maximum, Maximum3Integers, BoxMethods, MathMethods,PassByValue

October 28, 2003: Using Methods: GreenEggsAndHam, Squares1, Squares2, Squares3
Music: Listening to Ravel's Bolero ... for a repeated pattern, but played each time by a different instrument or group of instruments.

October 23, 2003: Multiplication table exercise

October 16, 2003: More work with "for" loops: RaiseToPower, ForStrings1, ForStrings2, ForStrings3, PrettyRug1

October 14, 2003: Using "for" loops: ForLoops1, ForLoops2, ForLoopsGeneral, Nested1, Nested2, Nested3, Factorials
Art: viewing regular patterns in kilims from Iran and Bulgaria from Kilims: A Buyer's Guide by Lee Allane

October 9, 2003: While Loop & Do-While Loop; Continue and Break keywords;
Class Discussion on Program Design: Probability... Rolling a die 1000 times
Class Discussion on Program Analysis: Prime Numbers ... Worksheet & program

October 7, 2003: String_2, String_3, String_4, Flag_1
Class Discussion on Program Design: Carpets
Some improvements you could add here: use "double" data type for the length and width; use a sentinel so the user, in this case perhaps an interior decorator, can keep adding the rooms as s/he walks through the apartment without knowing the number of rooms first.

October 2, 2003: Using accumulators, sentinels, markers: MaxNumber_1, MaxNumber_2, MaxNumber_3,
Introducing strings: String_1
Music: "Fugue For Tinhorns" from Frank Loesser's Guys & Dolls

Infinite Loops (M. C. Escher: "Handteckning" [Drawing Hands], 1948; lithograph.) and Programming: BadLoop

September 30, 2003: WhileLoopStudy, while_loop_1, while_loop_2, while_loop_3
Use the techniques in while_loop_3 as a debugging tool.

Music: Canon & Gigue in D Major by Johann Pachelbel (1653-1706)

September 25, 2003: random_numbers, random_numbers2, random_dice1, random_dice2, conditional_expressions, conditional_expressions2, concatenation1, concatenation2

September 23, 2003: grades_exmple3, grades_example4, directions_using_if, directions_using_switch , character_entry

September 18, 2003: ages, grades_example1, grades_example2, dice_using_if, dice_using_switch, switch_example2

September 16, 2003: pre_post_increment, casting_example, InputDataDemo, even_odd, less_than_five, date_check

September 11, 2003: circle_area, cylinder, circle_area_pi, assignment_operators

September 9, 2003:

September 4, 2003: addition, division

September 2, 2003: welcome, welcome2, and welcome3

Return to the course home page