Section 01 — Prof. Zaccone
Course Description
You can find information about section 1 here. (printable version)
Examples
- HelloPrinter.java — Example,
page 17
- ExerciseP30.java — Exercise
R1.12, page 30
- NamePrinter.java — Exercise P1.1,
page 30
- NamePrompt.java — Project 1.1,
page 31
- Sum10.java — Exercise 1.5, page 30
- Sum10Reciprocals.java —
Exercise 1.6, page 31
- Methods.java — demonstrates
assignment, methods and declarations
- EmptyFrameViewer.java —
example on page 59 of text
- MoveTester.java — accessor and
mutator methods
- RectangleComponent.java and
RectangleViewer.java display two
intersecting rectangles and color their intersection blue.
- Exercise214.java and EllipseComponent.java solve exercise P2.14 on
page 77 (fill a window with an ellipse).
- Exercise212.java and ColoredTextComponent.java solve exercise
P2.12 on page 77 (draw colored text).
- BankAccount.java — Bank Account
example from chapter 3
- Car.java, CarComponent.java, CarViewer.java — Chapter 3 example
- JavaDumb.java — demonstrates
primitive data types in Java
- BankAccountToString.java
— This version of the BankAccount class has a
toString
method. It demonstrates how to format the output so that there are two
places after the decimal. It also shows how to insert a Unicode character
such as the Euro symbol.
- Dialogs.java — Use dialogs for input
and output.
- Keyboard.java — Use the Scanner
class to read input from the console. Demonstrate the newline and tab
escape sequences.
- Square.java — Exercise P4.8, page
176
- Date.java, TestDate.java, Rectangle.java, TestRectangle.java — These are Professor
Meng's examples.
- Yes.java — Emulates the Unix
“yes” command.
- Triangle.java — demonstrates nested
loops.
- AmPm.java — demonstrates how to use a
Gregorian calendar object to determine the current time. PromptDouble.java — Use a loop, a dialog,
and a Scanner to prompt for an input value. Do it in a safe fashion that
never crashes.
- FileCounter.java — Counts the
number of lines, words and characters in a file. It is similar to the Unix
wc command.
- CopyFile.java — Make a copy of a
file using PrintWriter.
- TicTacToe.java — TicTacToe example
from the text. It shows how to use 2D arrays.
- Die.java — Simulates the throwing of a
die.
- Needle.java — Buffon's Needle
Experiment
- ArrayListTester.java — This
is the example on pages 294–295 of your text. Note that I have
corrected the typo we found in class.
Other Links
This page maintained by Rick Zaccone
Last modified: Fri Nov 20 15:29:57 EST 2009