CPSC 124: Introduction to Programming

   Department of Mathematics and Computer Science
   Hobart and William Smith Colleges

   Spring 2017.

   Instructor:  David J. Eck  (eck@hws.edu)

   Syllabus:  http://math.hws.edu/eck/courses/cpsc124_s17.html

   Monday, Wednesday, Friday, 10:10–11:05 AM
       Room Gulick 206A.

   Lab: Thursday, 11:55–1:20 PM
       Room Rosenberg 009.

Lab Worksheets
Lab 1, January 19
Introduction to Linux and Java
Lab 2, January 28
Using Subroutines
Lab 3, February 2
Lab 4, February 9
More Control
Lab 5, February 16
Lab 6, February 23
Eclipse / Subroutines

Quizzes and Tests, with Answers
Quiz 1, Jan. 27 Quiz 2, Feb. 3 Quiz 3, Feb. 13 Test 1, Feb. 20

Some Useful Links

Sixth Week: February 20, 22, and 24

After the test on Monday, we will move quickly on to Chapter 4, which covers subroutines. The reading for the week is Sections 4.1 and 4.2. Also, since I never had a chance to talk about the switch statement, we might look at it briefly; however, you will not be expected to use switch statements in the code that you write.

The lab this week will introduce the Eclipse IDE (Integrated Development Environment). You are required to use it for this lab, and I encourage you to use it for all of your programs for the rest of the semester. The lab will ask you to write a few simple subroutines.

Fifth Week: February 13, 15, and 17

There is a test next Monday, February 20. A study guide will be handed out in class on Wednesday.

The main topic for the week is arrays, Section 3.8. (We will not cover multidimensional arrays, Subsection 3.8.5, until later in the course.) If there is time, we will look more briefly at Section 3.6 and Section 3.7, which cover two additional control structures (switch and try..catch).

Fourth Week: February 6, 8, and 10

We continue with Chapter 3. The reading for the week is Sections 3.3, 3.4, and 3.5. The primary topics are for loops, multi-way if statements, and the break statement. We will cover do..while loops more briefly. You should be able to read and understand do..while statements, but you will not be forced to use them on a quiz or test.

The first exercise on the lab for the week is mainly about for loops. The second and final exercise is a longer, more complex program than you have written up to this point. It will require more thinking and planning, and it would be a good idea to start thinking about it in advance of the lab.

Third Week: January 30; February 1 and 3

The reading for the week is Section 2.5, Section 3.1, and Section 3.2. Section 2.5 covers the details of expressions, including arithmetic, relational, and logical operators, as well as type-casting, precedence rules, and type-compatibility rules for assignment statements. I will not cover this section in detail in class, but you should read it all. Section 3.1 introduces the basic looping an branching control structures, the while statement and the if statement. Section 3.2 talks about some techniques for developing programs. Next week, we will cover more details of control structures, but the information in Sections 3.1 and 3.2 is fundamental.

In the lab this week, you will write several programs that use if and while statements.

Second Week: January 23, 25, and 27

The reading for the week is Sections 1 through 4 of Chapter 2. We will cover the basic programming "statements": variable declarations, assignment statements, and subroutine call statements. There is a lot of material here: variables, data types, and literals; expressions that involve arithmetic operations and functions; the built-in functions in the Math class; output subroutines in System.out, input functions from the non-standard TextIO class; and operations on strings.

First Week: January 17 and 19

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, but they are not required reading at this time.

We will move very quickly into Chapter 2, which covers the most basic elements of Java programming. In fact, in the first lab, on Thursday, you will write your first simple Java programs. The lab web page will have enough information to get you started.

The required reading for the first week also includes the course handout!