CPSC 124: Introduction to Programming
Department of Mathematics and Computer Science Hobart and William Smith Colleges Spring 2017. Instructor: David J. Eck (email@example.com) 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. Regular Office Hours in Lansing 313 or 310 (but I am often available at other times): Monday and Wednesday, 11:15 to 12:10 Wednesday and Friday, 1:30 to 2:30 Thursday, 2:00 to 3:00
|Quizzes and Tests, with Answers|
|Quiz 1, Jan. 27||Quiz 2, Feb. 3||Quiz 3, Feb. 13||Test 1, Feb. 20|
|Quiz 4, March 1||Quiz 5, March 24|
Some Useful Links
- Introduction to Programming Using Java, the textbook for the course.
- PDF version of the textbook, good for reading on-screen.
- Java 8 Documentation and API. (local access only -- from off-campus use Oracle's copy: Documentation and API)
- A Style Guide for Java Programming.
- About Linux — Local information about using Linux at HWS.
- Download Site for JDK 8, where you can download a Java programming system for Mac OS or for Windows, if you want to be able to compile Java programs on your own computer. Note that you want to download the "JDK."
- 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.
Tenth Week: March 27, 29, and 31
We are still working on fundamental ideas about classes in Sections 5.1 through 5.4. We will move on to Section 5.5 by the end of the week. Section 5.5 covers subclasses, class hierarchy, inheritance, and polymorphism, which are core ideas in true object-oriented programming.
There will be a quiz on Friday on Sections 5.1 through 5.4. There is a test coming up next week on Wednesday, April 5, which will cover Chapter 4 and Chapter 5 through Subsection 5.5.2.
Ninth Week: March 20, 22, and 24
We will continue with Chapter 5, covering Sections 5.2 through 5.4. The emphasis for the week is on designing and writing classes. We will also look at a few of Java's built-in classes, including Object and Scanner. Although we haven't used it yet, Scanner is introduced in the textbook in Section 2.4.6.
You can expect a quiz in class on Friday on Sections 5.1 and 5.2.
Eighth Week: March 6, 8, and 10
You should read Section 4.7 carefully, but I will cover it pretty quickly in class. It covers scope, the final modifier, the reasons for using named constants, and the possibility of including an initial value for a variable in the declaration of that variable.
Section 5.1 introduces objects and object-oriented programming. In fact, you have been using objects from the beginning of the course, but this is the first time you are being asked to actually understand what is going on when you use them. Section 5.1 is one of the most of the important in the book. It contains essential information about objects that you need to understand fully if you are going to use objects effectively.
Next week is Spring Break. Enjoy!
Seventh Week: February 27; March 1 and 3
The reading for the week is Chapter 4, Sections 4.3 through 4.6. We continue to study subroutines, including parameters and return values. By the end of the week, we will be talking more about the broader view, including Java "packages", APIs (Application Programming Interfaces), and program development in general.There is a quiz on Wednesday of this week, on Wednesday.
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!