CPSC 124: Introduction to Programming
Department of Mathematics and Computer Science
Hobart and William Smith Colleges
Instructor: David J. Eck (email@example.com)
Course Handout: http://math.hws.edu/eck/courses/cpsc124_s14.html
Monday, Wednesday, Friday, 12:20--1:15 PM
Room Gulick 206A.
Lab: Tuesday, 1:30--2:55 PM
Room Gulick 208.
Office Hours in Lansing 313 (but also look for me in Lansing 310):
Monday, Wednesday, and Friday, 1:30 PM t0 2:45 PM
Tuesday, 12:00 noon to 1:20 PM
I will often be available MWF 10:00 to 11:00 AM and for
most of the day on Thursday -- but no guarantees.
|Pre-lab, January 24
Introduction to Linux
|Lab 1, January 28
Introduction to Java
|Lab 2, February 4
Functions, More I/O, Graphics
|Lab 3, February 11
Loops and Branches
|Lab 4, February 18
|Lab 5, February 25
Intro to Subroutines
|Lab 6, March 4
Eclipse (and Subroutines)
|Lab 7, March 11
||Lab 8, March 25
Some Useful Links
- Introduction to Programming Using Java, the textbook for the course.
- PDF version of the textbook, good for reading on-screen.
- Java 7 Documentation
(local access only -- from off-campus use Oracle's copy: Documentation
- A Style Guide for Java Programming.
- About Linux -- Local information about using Linux at HWS.
- Download Site for JDK 7,
where you can download a Java programming system for Windows, if you want to be able to compile Java programs on
your own computer. Note that you want to download the "JDK."
(For Mac OS 10.6 or earlier, Java is already be on your computer. For Mac OS 10.7 or higher, you will be offered the choice to install
Java the first time you try to use it. For Linux, it should be installable using
your regular software installer, but it is also avaliable on the Oracle download site.)
- Download Site for Eclipse, which we will use for programming later in the course.
Grab the "Eclipse IDE for Java Developers" if you want to use it on your own computer.
First Week: January 22 and 24
Welcome to the course!
You should begin reading the textbook, which is available
on-line at http://math.hws.edu/javanotes. During the first week of the term,
we will go over some of the introductory material in Chapter 1
fairly quickly. We will cover only a part of Chapter 1 in class, but it is a good idea to read the
entire chapter to get a preview of most of the topics that will be covered during the rest of the semester.
However, you should not expect to fully understand everything in Chapter 1 at this time.
The most important sections for now are
Section 1 and
Section 3. Sections 4, 5, and 6
give short overviews of many of the topics that we will cover in the rest of the semester.
On Friday, we will spend part of the class in the Gulick 208 computer lab. This visit will be
a "pre-lab" to get you acquainted with the Linux operating system.
The required reading for the first week also includes the
Second Week: January 27, 29, and 31
The reading for this week is Chapter 2,
Section 1 through Section 4. You are responsible for all material in these sections, except
for enums (Section 2.3.3) and scanners (Section 2.4.6). There are a lot of details, and only some of them
will be discussed in class, so it is important to carefully read the entire assigned material.
The lab on Tuesday is an introduction to Java programming. There is a link to the lab worksheet
earlier on this page. It is a good idea to read it before coming to lab. I will not hand out paper
copies of lab worksheets.
Computer science teaching assistants will have hours Sunday through Tuesday from 7:00 to 10:00 PM
in computer lab in room Lansing 310. My office hours are posted at the top of this page.
Remember that the first quiz is on Friday, January 31, at the start of class! Here are some things
that you should know about for the quiz:
main memory style
locations and addresses in memory variable
binary numbers data type
machine language assignment statement
high-level language javac command
compiler java command
Third Week: February 3, 5, and 7
On Monday, we will be finishing up
and Section 2.4
We will cover subroutines in String objects, formatted output, and comments.
On Wednesday, we will talk about some of the operators that are covered in
(Remember that we are not covering enums and Scanner, and we will put off TextIO
file I/O for a bit.)
This section has a lot of details about various kinds of operators; I will
talk about the most important in class. We will not discuss Section 2.6.
On Friday, we will move on to
You should read Sections 3.1 and 3.2, although we will not finish 3.2 until next week.
The second quiz is on Friday, February 7. Here are some things that could be on the
Writing some Java code to perform a specified task.
Reading some Java code and saying what it does.
primitive data types variable declaration statement
true and false reading input from the user
char literals like 'a', '\'' String functions
String literals like "Hello" str.length()
syntax of comments str.toUpperCase()
Fourth Week: February 10, 12, and 14
We will continue to work on control structures and algorithm development.
By the end of last week, we had covered while loops and basic if statements.
We will start this week with some examples, and we will discuss the use of pseudocode to
express algorithms. That will finish up Sections 3.1 and 3.2.
The new reading for the week is Chapter 3,
Sections 3.3 to 3.5, which cover additional control structures (for, multi-way if, and do..while), as
well as the break statement.
There will be another quiz this Friday, February 14. It will cover Sections 2.5, 3.1, and 3.2.
This includes all the basic Java operators (+, -, *, /, %, ==, !=, <, >, <=, >=,
&& ||, !, ++, --, +=, -=), type-casting, operator precedence, generating random integers, while loops,
if statements, and if-else statements. You should also be familiar with the
concepts of pseudocode and step-wise refinement from Section 3.2.
Fifth Week: February 17, 19, and 21
There is no quiz this week, but there is a test coming up next week, on
Monday, February 24. The test will cover Chapters 1 through 3.
A study guide will be distributed in class on Wednesday.
We will finish up Chapter 3 this week. The new reading is
which introduces exceptions and the try..catch statement. Section 3.8
is an introduction to GUI programming; it is not repart of the reading,
but the material in this section has been covered on labs.
We still have to cover "else if" statements more thoroughly, and there are
a few loose ends to tie up, including blocks and local variables. I should also
mention definite assignment, the continue statement, and labeled
break statements, but they might just be left to reading since I will not require
you to know them for the test or for lab exercises.
Sixth Week: February 24, 26, and 28
There is a test on Monday, February 24. Here is the study guide.
And here are the sample solutions.
On Wednesday, we will start Chapter 4,
which covers writing and using subroutines. It also covers global variables, that is, variables that
are declared outside any subroutine. Note that subroutines in Java are also called methods,
and I will start using the term method as a synonym for subroutine. The reading for the week is
Sections 4.1 and 4.2.
Because of the test on Monday, I will not collect Lab 4 until Thursday morning.
Seventy Week: March 3, 5, and 7
We will continue with Chapter 4 and
with subroutines. The reading for the week is Sections 4.3 to 4.6, although we might not
complete 4.6 until next week. You will find that we have already covered some of the material
in 4.3 through 4.5.
this week will introduce the Eclipse Integrated Development Environment. Although it is
a big complex system, you will find that it will help you be a more productive programmer in
There is a quiz on Wednesday of this week, covering mainly Sections 4.1 and 4.2. You should
expect to be asked to write at least one complete subroutine. Other things that could be on
the quiz include:
black box, interface, implementation
subroutine, method, calling a subroutine
dummy parameter, actual parameter
function, return type, void
access modifier, public and private