|
These files contain the Java source code for applications and applets that are used in class. The source files are listed by the date on which they are used. Also on this page are the reading assignments from our Java textbook.
For the code examples, you can click on either a .java link and see the source code, or click on a .html link (if there is one) and see the applet running. If you click on a .java link to view a source file, you can then use the "File -> Save As..." menu item of your browser to save the source file on your computer. Once you have saved an example source file on your computer, you can use your editor to modify it, which is a good way to experiment with Java. Experimenting with examples is one of the best ways to learn programing. These examples are based on the book "Computing Concepts with Java 2: Essentials", 2nd Ed., by Cay Horstmann.
If you would like to see more examples of applets, here are all last year's examples for this course.
|
- Wednesday, May 3.
- Here are review problems for the exam on Monday, May 8. The exam will cover Chapters 2, 3, 4, 5, 6, and 11 of the Java textbook. Be sure to also review the exercises from the textbook that were assigned earlier in the semester and are listed further down in this page.
- PascalTriangle.java,
PascalTriangle.html
- BitPattern.java,
BitPattern.html
- CellularAutomata.java,
CellularAutomata.html
- CellularAutomata2.java,
CellularAutomata2.html
- CellularAutomataAnimation.java,
CellularAutomataAnimation.html
- Monday, May 1.
- Wednesday, April 26.
- Monday, April 24.
- RandomWalk.java,
RandomWalk.html
- RandomWalk2.java,
RandomWalk2.html
- RandomWalk3.java,
RandomWalk3.html
- CircleSquared.java,
CircleSquared.html
- CircleSquared2.java,
CircleSquared2.html
- Lyapunov.java,
Lyapunov.html
- Read Chapter 11, Sections 11.1, 11.2, 11.3, 11.5, and 11.7.
- Do Review Problems 11.1, 11.2, 11.4, 11.5, 11.9.
- Wednesday, April 19.
- Monday, April 17.
- Wednesday, April 12.
- Bigger.java,
Bigger.html.
- GuessingGame.java,
GuessingGame.html.
- GuessingGame2.java,
GuessingGame2.html.
- DartGame.java,
DartGame.html.
- BadBoolean.java
- Read Chapter 6, Sections 6.1, 6.2, 6.4, 6.5.1, 6.5.2, 6.6.
- Monday, April 10.
- CarDrawer.java,
CarDrawer.html.
- ColorSelect.java,
ColorSelect.html.
- Read Chapter 5, Sections 5.1-5.4.
- Do Review Problems R5.1, R5.2, R5.6, R5.8, R5.9, R5.10, R5.13, R5.20.
- Wednesday, April 5.
- Monday, April 3.
- Wednesday, March 29.
- Coins1.java.
- Coins2.java.
- Coins4.java.
- Coins4.java.
- The next file is necessary for reading input from users of a Java program and it needs to be in the same directory of any Java program that accepts user input. This file is used, for example, in Coins4.java, and you will need to use it for your first Java homework assignment.
- MakePassword.java.
- For next Monday, read Chapter 3, Sections 3.1-3.5, pages 103-116.
- Monday, March 27.
- Hello.java.
- MoveRectangle.java.
- IntersectRectangle.java.
- The next program is a template file that you can use to get started doing some of the exercises.
- For Tuesday, read Chapter 2, Section 2.1, pages 48-52, Section 2.2 pages 56-58, Section 2.3, pages 59-62, Sections 2.4-2.7, pages 66-83.
- Do Review Exercises R2.1, R2.2, R2.3, R2.5, R2.6, R2.7, R2.8, R2.9, R2.17 (these are practice exercises, not homework to turn in).
- Wednesday, March 22.
- Monday, March 20.
- For next Monday, read Chapter 1 from the Java textbook, especially sections 1.7 through 1.10. Compile and run the following simple program as described in sections 1.8 and 1.9.
- Hello.java.
- Try to do Programming Exercises P1.3 and P1.4 from pages 45-46 of the Java textbook (this is a practice exercise, not a homework to turn in).
|
|
|
|