CIS-2271 (Java Programming) Home Page
This is the home page for Peter Chapin's CIS-2271 course notes for the Fall 2014
semester. Here you will find slides, homework assignments, program samples, and links to
other references of interest.
- The course syllabus gives an overview of the course
and its content, lists course resources, and describes the grading policy and related
issues.
- The homework submission area and the grade book are on Moodle but all other course
resources are here.
- Sample code for this class will be provided via several methods. However, the master
copy of the samples, including samples from past editions of this course, is in the class GitHub repository. Use of Git is not
required for this class but if you are curious read my short
document on Git.
- My home page contains other resources of potential
interest.
Adobe Connect
You can view a (24 minute)introduction to the class that shows how it will look over over
Adobe Connect (slides). All live lectures will be accessed
from the same URL.
- Introduction. Walk through of the basic "Hello, World" program with comments about
Eclipse. Brief introduction to variables and expressions.
- Primitive types and expressions, precedence, and associativity (slides). Demonstrated the Quadratic
and Areas
samples. Introduced Lab #2.
- Demonstration of basic
string handling methods, introduction to conditional statements by adding input
validation to the Quadratic sample.
- Introduced Lab #3. Covered more on conditional statements: if... else if... and
logical operators. See the Age
sample.
- Discussed the switch statement and introduced for loops. See the SwitchDemo
and Prime
samples.
- More about looping with for loops and while loops. Demonstrated nesting loops. See the
Prime2
and MonteCarlo
samples.
- Reviewed the solution of Homework #2, talked about code formatting, introduced arrays
and reference types. See the ArrayDemo
sample.
- Provided some hints about Homework #3. Worked through an example program that
implements the Sieve of
Eratosthenes. See the Sieve
sample.
- Showed a sample that reads an input file of arbitrary size into an array. Demonstrated
the Eclipse Java debugger. See the TextProcessingDemo
sample.
- Reviewed some issues that arose in Homework #4 and Lab #5. Demonstrated
ArrayList. Introduced methods. See the TextProcessingDemo2
sample.
- Discussed Lab #6. Demonstrated using methods to refactor a program. See the Prime3
sample.
- Introduced the concept of packages and imports. Demonstrated unit testing in Eclipse
with JUnit.
- Review of some concepts (packages, unit testing) and sketched out Clacky v1.0 to be
built after break.
- An example of incrementally growing a small program. The example reviews loops (nested
loops) and creating methods to simplify complicated code fragments. The
Main file is in the Chess project on GitHub.
- Introduction to classes using an example Rational number class.
- Continued the Rational number example and introduced exceptions and exception
handling. The files are in the Clacky
project on GitHub.
- More on exceptions. Discussed in detail an example of a SimpleDate
class from Figs.
- Discussed program organization; pushing code into a class where the structure of the
data being manipulated can be hidden.
- Introduced the use of interfaces as a tool for creating higher level abstractions.
Showed examples of interface Date
(from Figs) and interface Storage
(from Clacky).
- A few comments about inheritance. Demonstrated the Look sample
program that reads a text file using the java.io.FileReader class.
- Discussion about Lab #9: How to handle exceptions via the
Storage interface. How to count disk files using java.io.File.
- Discussed the Comparable interface and how to use it. Introduced the Java collections
library.
- Demonstration of the collection library with MailMap
program. This example demonstrates maps, sets, and iterators.
- Introduction to GUI programming using the TemplateFrame
example (largely taken from Chapter 10 in the text).
- Continued the discussion of GUI program started previously with a demonstration of
JTextArea as needed in Lab #11.
- Review of exception handling with an emphasis on the underlying concepts behind the
use of exceptions.
- Review of the concept of references and how data is passed to and returned from
methods.
Homework
- Homework #01. Due: Tuesday, 2014-09-02.
- Homework #02. Due: Thursday, 2014-09-11.
- Homework #03. Due: Thursday, 2014-09-18.
- Homework #04. Due: Thursday, 2014-09-25.
- — Homeworks below are subject to change —
- Homework #05.
- Homework #06.
- Homework #07.
- Homework #08.
- Homework #09.
- Homework #10.
- Homework #11.
- Homework #12.
Labs
Many of the labs in this course pertain to an extended semester-long project. This year
we will be building a simple calculator program called Clacky.
- Lab #01: Eclipse. In this lab you will learn the basics of
the Eclipse development environment.
- Lab #02: Types and Expressions. In this lab you will get
some experience using Java types and expressions and an introduction to the if
statement.
- Lab #03: Input Validation. In this lab you will practice
writing if statements by extending Lab #2 to more carefully validating the
inputs.
- Lab #04: Loops. In this lab you will use a loop to process a
line of text containing multiple words.
- Lab #05: Clacky version 0.1. In this lab you will write a
simple four function calculator.
- Lab #06: Methods. In this lab you will write several short
methods and get more practice with loops and arrays.
- Lab #07: Clacky version 1.0. In this lab you will combine
and extend your work from Labs #5 and #6 to create a fully operation four function
calculator that can compute on integers of any size.
- Lab #08: Clacky version 1.1. In this lab you will create a
class that provides a register storage area for clacky. You will extend clacky to allow
users to compute with rational numbers and to store temporary results into registers.
- Lab #09: File I/O. In this lab you will continue extending
Clacky so that it can save registers to files.
- Lab #10: Collections. In this lab you will add support in
Clacky for reading and using a configuration file of name/value pairs. This lab gives you
practice using the Map collection and more practice with file I/O.
- Lab #11: GUI Programming. In this lab you will wrap up the
Clacky program by creating a simple graphic interface for it.
- — Labs below are subject to change —
Last year's lab project was a datebook management program called Figs. The lab set for that project is available for historical purposes.
Links
The various links of interest.
- Java SE
Download. On this page you can download the Java JDK (get the JDK, not just the JRE.
The development kit includes the runtime environment and also has the Java compiler and
related tools.
- Eclipse. Here you can download a copy of the
Eclipse IDE for your computer. I recommend getting either "Eclipse Standard" or "Eclipse
IDE for Java Developers." Both of those flavors contain the tools necessary for this
course but the version specialized for Java contains some addition tools you might want to
experiment with. It is possible to add tools later also. I have prepared a web page that
describes how to set up Eclipse for Java programming.
- Java JDK 8 Documentation. The
official documentation set for Java 8 includes information on all the classes in the
library that ships with Java.
- Operator precedence and
associativity chart for Java operators.
Last Revised: 2014-12-19
© Copyright 2014 by Peter C. Chapin
<PChapin@vtc.vsc.edu>