CPSC 124: Introduction to Programming
Department of Mathematics and Computer Science Hobart and William Smith Colleges Fall 2017. Instructor: David J. Eck (firstname.lastname@example.org) Syllabus: http://math.hws.edu/eck/courses/cpsc124_f17.html Monday, Wednesday, Friday, 10:10–11:05 AM Room Gulick 2000 (formerly room number 206A). Lab: Thursday, 1:30–2:55 PM Room Rosenberg 009. Office hours in Lansing 313 (but also check the computer lab, Lansing 310): MWF, 11:15–12:10 WF, 2:00–3:00 (I am also often available at other times.)
|Lab 1, August 31
Intro to Linux and Java
|Lab 2, September 7
|Lab 3, September 14
|Lab 4, September 21
|Lab 5, September 28||Lab 6, October 5|
|Quizzes and Tests, with Answers|
|Quiz 1, Sept. 8||Quiz 2, Sept. 15|
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.
First Week: August 28 and 30; September 2
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. Section 2 is not particularly relevant to this course, but contains some interesting information about the way computers work.
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!
Second Week: September 4, 6, and 8
The reading for the week is Chapter 2, Section 2.3, Section 2.4, and Section 2.5. (There are a few topics in those sections that we will not cover, at least for the time being, including 2.3.4 on Enums, 2.4.4 on Files, and 2.4.6 on Scanner. We also won't be using the output functions from TextIO.)
In Section 2.3, we will be covering some mathematical functions and subroutines for use with strings. In 2.4, we will encounter TextIO.java, which can be used for getting input from the user on the command line. TextIO is not a standard part of Java. I have written it to make text input more convenient. (The more standard alternative to TextIO is the Scanner class.) And in 2.5, we will see some details of mathematical expressions.
The first quiz for this course will be this Friday, September 8, at the beginning of class.
Third Week: September 11, 13, and 15
We are moving on to Chapter 3 this week. The reading includes sections 3.1, 3.2, and 3.3. Chapter 3 covers control structures, starting with basic if statements and while loops in Section 3.1. Section 3.2 is an introduction to how to think about developing correct algorithms for solving problems. It introduces the ideas of algorithm and pseudocode. Section 3.3 covers more details of while loops and do..while loops, inclulding the break and continue statements.
There will be another quiz this week, on Friday, September 15. You can expect some questions that ask you to write Java code segments.
Fourth Week: September 18, 20, and 22
We will dive into for loops, Section 3.4, on Monday. From there, we will jump to arrays, Section 3.8, a kind of data structure that is often used with for loops. And on Friday, we will return to Section 3.5, to talk about the if..else if..else construction.
We have covered the do..while statement briefly. You should know what this statement means, but you will not be required to use it on quizzes or tests. Similarly, you will not be required to use any switch statements, even if we do cover it in class next week. You are, however, definitely responsible for using all forms the if statement, while loops, for loops, and the break statement.
You can expect another quiz this Friday, September 22. It will cover through Section 3.4 (that is, for loops but not arrays). The first test will be the following week, on Friday, September 29.