Examples from Class

Please report broken links to azs@bu.edu

Class meeting Concept Examples from class
Tue 1 July General Java syntax, Standard output
Procedural Decomposition
HelloWorld.java
HappyBirthday.java
Thu 3 July Variables, data types
Assignment statements
Arithmetic
CommonProgrammingErrors.java
DataTypesAndVariables.java
ArithmeticAndMath.java
FunWithCasts.java
InputFromKeyboard.java
HigherMath.java
Mon 7 July Methods with Parameters
Definiete loop
Accumulator design pattern
CalculateRafterLength.java
DefiniteLoops.java
BottlesOfBeer.java
Adding.java
Tue 8 July Definiete loop (one more example with nesting)
Formatted numeric output with printf
Using the Java API/calling methods
Timer.java
UsingClassMethods.java
UsingObjectMethods.java
Thu 10 July Introduction to Graphics (coordinates, drawing, basic Colors)
Calling methods and passing arguments
Object reference variables.
Object creation using new.
Drawing.java [some code to get us started]
Drawing.java (the drawing I did in class in Summer Session 1)
Mon 14 July Logical Expressions
Selection using if statements.
Comparing floating point numbers,
Comparing objects (e.g. String),
LogicalExpressions.java
DecisionMaking.java
MinOf3Ints.java
ComparingFloatingPoint.java
ComparingObjects.java
Tue 15 July Review definite loops
Repetition using while loops loops.
Sentinel-controlled repetition.
Infinite and busy loops
Average01.java
Average02.java
Average03.java
Average04.java
BottlesOfBeer2.java
YesOrNo.java
Average05.java
BusyLoop.java
Thu 17 July Text representation, String operations
File operations
StringOperations.java
Substitute.java
ReadingFromFile.java
WriteToFile.java
Mon 21 July
Introducing arrays
Array allocation (initializer list, allocation by size only)
Array indicies, assignments, iterating with for loops.
ArrayOperations.java
ArrayAllocation.java
LetterCount.java
Tue 22 July Copying arrays, shallow vs deep copy
for... each loop>
Arrays of objects
User-defined classes
- member variables
CopyingArrays.java [updated]
ForEachLoop.java
ArraysOfObjects.java
Die.java
TestingDice.java
Thu 24 July User-defined classes: constructors, methods
toString, equals methods
Die.java [updated]
TestingDice.java
GameOfCraps.java
Mon 28 July Inheritance, class hierarchies
Constructor chaining, overridden methods
PlayingGames.java
Tue 29 July Abstract methods and classes
Interfaces
Introducing Recursion
- base case versus recursion
- method call stack
MooBahLaLaLa.java
AnimalKingdom.java
RecursionExamples.java
Thu 31 July
Multidimensional Arrays
Multi-dim array operations
MultiDimArrays.java



Created by: Aaron Stevens, azs@bu.edu
http://www.cs.bu.edu/courses/cs111
Last update: 31 July 2008