CS112 Introduction to Programming, Spring 2017 - Course Info

   Home   –   Overview   –   Schedule   –   Assignments  –   Practice  –   Help  

General Information

CS112: Introduction to Programming, Spring 2017

MWF 11:35-12:25 at Davies Auditorium

Yang (Richard) Yang, 208A Watson, 432-6400, yry@cs.yale.edu

Teaching Fellows:
  • Anushree Agrawl, anushree.agrawal@yale.edu
  • Austin (Trey) Lachance, austin.lachance@yale.edu
  • Ben Rodriquez-vars, benjamin.rodriquez-vars@yale.edu
  • Chen Gu, chen.gu@yale.edu
  • Chris Kim, christopher.kim.cmk69@yale.edu
  • Elle Buellesbach, elle.buellesbach@yale.edu
  • Jason Chu, jason.chu@yale.edu
  • John Daniswara, johnamadeo.daniswara@yale.edu
  • Julia Lu, julia.lu@yale.edu
  • Justin Shi, justin.shi@yale.edu
  • Kristina Shia, kristina.shia@yale.edu
  • Lincoln Swaine-Moore, lincoln.swaine-moore@yale.edu
  • May Wang, haoran.wang@yale.edu
  • Neil Zheng, neil.zheng@yale.edu
  • Nishant Jain, nishant.jain@yale.edu
  • Omar Ashraf, omar.ashraf@yale.edu
  • Pong Trairatvorakul, prawat.trairatvorakul@yale.edu
  • Qiao Xiang, qiao.xiang@yale.edu
  • Qilin Sun, qilin.sun@yale.edu
  • Sam Laing, samuel.laing@yale.edu
  • Sean Guo, sean.guo@yale.edu
  • Shane Fenske, shane.fenske@yale.edu
  • Tommy Liao, thomas.liao@yale.edu
  • Yinfeng Zhang, yinfeng.zhang@yale.edu
  • Yuxuan Ke, yuxuan.ke@yale.edu

  • Objectives

    CS 112 is an introductory programming course, using the Java programming language. There is no prerequisite for the course -- in particular, no prior programming experience is required -- although it helps to be "computer literate."

    By the end of the course you should be able to write useful Java programs.  But the focus of the course is programming concepts, so besides learning how to write cool artifacts you will also learn things like object-oriented programming (classes, methods, objects, etc.), control structures (conditionals, looping, recursion, etc.), data types (arrays, strings, numbers, lists, queues, stacks, etc.), basic algorithms (sorting, searching, etc.), and some advanced ideas (exception handling, input/output streams, etc.).

    Textbooks and Materials

    The required textbook is:

  • Stuart Reges and Marty Stepp. Building Java Programs: A Back to Basics Approach (4th ed.) URL: http://www.buildingjavaprograms.com/. Our impression is that the fourth edition of the book is different from the third or second edition in ways that probably will not matter much for this course. The 4th edition is based on Java 8, 3rd edition Java 7 and the 2nd on Java 6, but the language enhancements are mostly not relevant to our course. So a used copy of the second or third edition is probably perfectly fine; see if your roommate took CS112 last year.
  • An additional book that we will draw examples and exercises is:

  • Robert Sedgewick and Kevin Wayne. Introduction to Programming in Java: An Interdisciplinary Approach . URL: http://introcs.cs.princeton.edu/java/home/
  • A few additional good Java books include:

  • A best book overall for post-cs112 Java learning is Thinking in Java (4th Edition) by Bruce Eckel, Feb. 2006, by Prentice Hall. The newest version is version 4, but the 3rd version is good enough for most of us, and free available online at: http://www.mindview.net/Books/TIJ/
  • Another good book is: Java Examples in A Nutshell (3rd Edition) by David Flanagan, Jan. 2004. See http://safari.oreilly.com/?XmlId=0-596-00620-9 (you can access the book online if you are using an Yale IP address; i.e., on Yale campus or use Yale VPN).
  • Additional course materials will be available "on-line," as described below:

  • Assignment and Grading.  All problem assignments will be available on-line, demonstrated in class, handed in electronically by the students, graded on-line, comments mailed electronically to students on-line, and grades posted on-line for each student to review.
  • Class Lectures.  Class lectures will be conducted on-line, using the projection facilities in the classroom.  The instructor will be able to demonstrate Java programming concepts, and respond interactively to student questions. The professor's real-time lecture notes will be available in the lecture log, possibly polished a bit.
  • Software Library.  There will be an on-line class library, which contains special software for the course, and example programs from the textbook. Students will usually be able to try out a program from the book without having to type it in from scratch.

  • Why Java

    You have probably heard of Java. It has received more media attention than probably any other programming language.  Most of this attention is unfortunately hype, but nevertheless Java is a good programming language, and has many pedagogical advantages over other languages.

    You may have also heard of other  programming languages, such as BASIC, C, C++, Object C, Ada, Lisp, and FORTRAN.  Although all of these languages are billed as "general purpose," some are better at certain things than others, and thus one's application often dictates one's choice of a language.  For example, in the Computer Science Department, FORTRAN is taught in CS-130 (for scientific computing), C in CS-323 (systems programming), Lisp in CS-470 (artificial intelligence), etc.  Using this line of reasoning, Java is usually billed as being good at portability and the Internet.

    Java is a good general-purpose programming language that uses many recent innovations in programming language design, making it a quite modern and powerful language.  It is also simple enough to use in a course such as CS-112, and once you know one programming language, it is much easier to learn another (in contrast to learning natural languages).  Java has many attractive characteristics, including the following:

  • Simple. Java's relative simplicity is its prime attraction as an introductory programming language.
  • Safe. Java was designed to be robust. Its type system is a major source of this robustness, and the absence of pointers removes one common source of problems. Java also provides exception handling and other methods for creating programs that are less likely to crash.
  • Free. Java developers can download the Java Development Kit (JDK) for free.
  • Cross-platform. A Java program written for one platform, such as a PC or Linux, will run on any other Java platform automatically. Java programs are compiled into platform-independent byte-codes.
  • Object-oriented. In Java, (almost) everything is an object. In fact, there are no functions or procedures -- just class methods. Java supports single inheritance. For simplicity, there is no multiple inheritance, but interfaces serve much the same purpose.
  • Multimedia support. The standard Java library has support for graphic images, animation, and sound.
  • Ubiquitous. Java applications are spreading throughout the Internet.
  • Related to C/C++. Java contains 90% of C++, and vice versa. Students who already know C or C++ will have little problem learning Java. Students who learn Java first will have little difficulty picking up C or C++.

  • Grading

    There will be weekly or biweekly programming assignments (called psets) -- about 9-10 in all. For the most part, these will be computer programs written in Java. Each student is expected to do each assignment on her/his own except when we specify specific format. See the Collaboration Policy below.

    Grading will be based not just on whether your program runs or not, but also on how well it is written: it should be well-structured, documented, and generally easy for someone else to read and understand. In other words, the style of your program is important.

    Each programming assignment (pset) will be given equal weight. We will have a midterm and a final project, where the midterm counts for 1.5x pset and the final project counts for 2x pset.

    Late-assignment Grading

    Assignments must be turned in by the specified date and time. For an extension of this deadline, you must have a dean's excuse. Of course, a Dean's Excuse may be used to wrangle whatever deal you can manage from the instructor. Cases of incapacitating illness followed by miraculous recovery before the end of the term are negotiable.

    To allow for the exigencies of computer failures and personal crises, each student will have 9 discretionary late days for problem assignments, but any one assignment may only be up to 3 days late (this is because we may discuss solutions to assignments in class). These are calendar days, not business days. As the homework assignments will be submitted electronically, the "write date" on the student's homework file will be considered the completion date for late assignments. Thus, a student may "hand in" a late assignment on a Saturday or Sunday. 

    After you use up all of your discretionary late days, assignments turned in late will be graded according to the following formula: S = R * (1 - t / c), where S is the grade given, R is the grade the work would have gotten if turned in on time, t is the amount of time by which the work was late, and c is equal to 6. Thus, the value of a late assignment decays daily, with a half-life of just over 3 days. Examples: work turned in five minutes late gets 99.9% credit, one hour late gets 99.3% credit, six hours late gets 95.8% credit, one day late gets 83.4% credit, two days late gets 66.7%, and three days late gets 50.0%. Assignments submitted more than 72 hours late (after the official deadline) will not be accepted.

    Collaboration Policy

    Programming, like composition, is an individual creative process. Individuals must reach their own understanding of the problem and discover a path to its solution. During this time, discussions with friends are encouraged. However, when the time comes to write the code that solves the problem, such discussions are no longer appropriate -- the program must be your own work (although you may ask teaching assistants or lab assistants for help in debugging).

    Do not, under any circumstances, copy another person's program. Writing code for use by another or using another's code in any form violates the University's academic regulations and will be dealt with harshly. We will carefully screen programs for evidence of copying, using a combination of automated tools and human eyeball.


    Attendance at lectures is expected but will not be recorded. Students are, however, fully responsible for all material presented in lectures, even if some of it does not appear in the "official" lecture notes. Class attendance is recommended strongly.

    Keeping In Touch

    We will use the class server to keep in touch.

    If your question is more like "What in the world does this homework assignment mean?" or "Help!", come see us in person.

    You should read both the course home page rather frequently as they appear for important information, such as lecture notes, instructions on submitting your assignments, clarifications and hints, last minute schedule changes, etc.

    Copyright (c) 2000-2017 Y.R. Yang, Department of Computer Science, Yale University