CS106A: Programming Methodologies
Winter 2017
Monday, Wednesday, Friday 10:30 to 11:20am in NVIDIA Auditorium


CS106A Info
Course Schedule
How to Submit
Lecture Videos
icon Eclipse
Karel Book
icon Stanford Java Lib
Blank Java Project
Blank Karel Project
Help Hours



Monday, Feb 13th

Monday, March 20th


Lecturer: Chris Piech
Gates 193
Wed 1-3pm

Head TA: Nick Troccoli
Gates B02
Th 1-3pm


Sun 8-10PM PST

Mon 6:30-7:30PM PST

Tues 7-8PM PST

Wed 6-8PM PST

Join Google Hangouts here at the times above.


Extra Credit: Debugger

To encourage you to become more familiar with the Eclipse debugger, we have created a short (~30min - 1hr) optional extra credit debugging assignment. On the extra credit information page, you will find an Eclipse project that is supposed to animate a ball that bounces off the 4 walls. However, there are some bugs lurking that are preventing the program from functioning correctly. If you can find and fix all 4 bugs, the program will give you a secret code that you can send to your Section Leader for extra credit points! See the the extra credit information page if you're interested in trying it out. The answers will be released alongside the section solutions at the end of the week, so if you would like to get extra credit points you must email your secret code to your Section Leader by 5PM on Friday 3/3.


In your penultimate assignment you will program a data visualizer: NameSurfer. See the assignment page for the handout and starter code. Assignment 6 YEAH hours will be Wednesday March 1st, 7:30-9PM in Bishop Auditorium (in Lathrop Library).


One of the joys of programming is the ability to make something totally of your own creation. In CS106A this quarter we are hosting a Graphics Contest where you can program anything you like using the concepts and tools we learn in class. There will be four grand prizes which each are worth a 100% on the final exam. Runners up will be awarded extra credit on assignments. See the contest handout for more details.

Midterms Returned

Graded CS106A midterms were returned after class on Wednesday, Feb. 22 via Gradescope, an online assignment grading website; if you did not receive an email inviting you to Gradescope (check your spam folder just in case), please email Nick, the Head TA. See the midterm solutions for reference. If your scanned exam in Gradescope is difficult to read, and you would like to see your (ungraded) paper exam, you can pick it up from the CS106A filing cabinet in the "handout hangout", the lobby down the hall from Chris's office (Gates 193). Please note that while grading we referenced both the paper and scanned versions to ensure your work was correctly graded.

The median for the CS106A midterm was 41 out of 60 points. Here is the full distribution:

If you believe part of your exam was incorrectly graded, regrade requests will be accepted through Gradescope until Wednesday, March 1. As part of your request, you will need to provide a short write-up of the problem(s) on your exam that you think were misgraded. Regrade requests need to point out the aspect of the problem that was correct, but for which points were taken off. We use a detailed rubric to grade exams, so simply requesting that an incorrect answer "should be worth more points" is not likely to result in additional points. Also, we reserve the right to re-grade the whole exam to make sure there are no other grading issues present - this may result in a lower total score.


Assignment 5: Yahtzee

In your fifth assignment you will program the classic game of Yahtzee! See the assignment page for the handout and starter code. Assignment 5 YEAH hours will be Tuesday 2/21, 7:30-9PM in Bishop Auditorium (in Lathrop Library). As a reminder, YEAH hours, or “Your Early Assignment Help” hours, are optional sessions meant to provide additional help getting started with each assignment. We hope to see you there!

Assignment 4 Correction

We found a small bug when running the Hangman starter code on Windows machines. Specifically, due to the way Windows displays Eclipse programs, the height of the screen is 20 less than when running on a Mac. For this reason, the constant Y value given for the incorrect guesses label (INCORRECT_GUESSES_Y) is off-screen.
To resolve this issue (for consistency, every student please do this, Mac or PC), PLEASE CHANGE INCORRECT GUESSES_Y and PARTIALLY_GUESSED_Y to the following:

/* The y-location to display the partially guessed string */
private static final int PARTIALLY_GUESSED_Y = 430;
/* The y-location to display the incorrectly guessed letters */
private static final int INCORRECT_GUESSES_Y = 460;

The starter code on the website has also been updated to reflect this change. We apologize for the last-minute change; if you do not make the above change, you will not be penalized if your incorrect guesses label is offscreen, as long as you are positioning it correctly. But the above change may help ensure that your calculations are correct.

UPDATED [x3]: Midterm Exam

To give you resources to help prepare for the midterm, we have posted practice midterm and exam strategies handouts. We recommend taking the practice midterm under similar conditions to the regular exam. Solutions to the practice midterm have also been posted. As a reminder, the midterm exam is Monday 2/13 7-9PM and is open book, open notes, closed-electronic-device. It will cover everything through lecture on 2/8 except for file-reading. UPDATED: Notably, you will not be required to write imports on the exam.

UPDATED: We held a midterm review session Sat. 2/11 4-6PM in Bishop Auditorium. We went over class concepts that may appear on the midterm, and additional practice problems. The slides are available here. Due to technical troubles, unfortunately we were only able to capture the audio from the session, which is available on the lecture videos page.

UPDATED: The midterm exam will take place in Memorial Auditorium:

Assignment 4 YEAH Hours Materials Posted

Thanks to everyone who came to YEAH hours for Assignment 4! The slides have been posted to the Assignment 4 page. Additionally, a recording of the video is available on the lecture videos website.

Assignment 4: Hangman

Assignment 4 (Hangman) has been released, a fun console+graphics game that will give you practice with strings and file-reading - see the assignment page for the handout and starter code. This is also the first assignment that may be done (optionally) in pairs.. As a reminder, you may only pair up with students in the same section time and location. Assignment 4 YEAH hours will be Thursday 2/9, 7:30-9PM in Bishop Auditorium (in Lathrop Library). We hope to see you there!

Alternate Midterms

The midterm is Monday, Feb 13th, from 7pm to 9pm. If you can't make the scheduled time because of an academic conflict please send Chris and Nick an email over the weekend (before Monday 6th of Feb). We can find an alternate time for you to take the exam.

Assignment 3 YEAH Hours Materials Posted

Thanks to everyone who came to YEAH hours for Assignment 3! The slides have been posted to the Assignment 3 page. Additionally, a recording of the video is available on the lecture videos website.

Assignment 3: Breakout

In your third assignment you will program the classic game of Breakout! See the assignment page for the handout and starter code. Assignment 3 YEAH hours will be Tuesday 1/31, 7:30-9PM in Bishop Auditorium (in Lathrop Library). As a reminder, YEAH hours, or “Your Early Assignment Help” hours, are optional sessions meant to provide additional help getting started with each assignment. We hope to see you there!

Assignment 2 YEAH Hours Materials Posted

Thanks to everyone who came to our first YEAH hours for assignment 2! The slides have been posted on the assignment 2 page. Additionally, a recording of the session is available on the SCPD/online videos page (link in sidebar).

Second Assignment: Simple Java

For your second assignment, you'll get practice writing a series of small Java programs. These programs consist of both console and graphics programs, and will give you practice with concepts like variables, methods, control flow, and more. Please note that for problems 4+5, we recommend waiting until after Wednesday's lecture to get started, as some material we cover that day will help you with those problems.

Extra Karel Example: Random Painter

Some of the problems on assigment 1 are difficult! I made a recording of an extra example called "random painter" that solves a problem relevant to checkerboard karel. Check it out if you want some extra review. I also uploaded the random painter code.

Submit Assignment 1

If you haven't tried submitting yet, give it a shot. See the submitting handout for instructions. You can submit assignments as many times as you like, we grade your last submission. Assignment 1 is due Friday at 10:30am.

Section Assignments / Late Signups

For those who submitted section preferences by 5PM on Sunday, we have finished emailing out section assignments; as a reminder, sections start this week! If you were unable to submit the form by the 5PM Sunday deadline, the late signup form is now open. Click on the "Sections" tab to get to the form link. As a reminder, SCPD students should sign up for the "SCPD section", unless you are able to attend a section in person.

If you would like to permanently switch into another section, there is also a link under "Sections" to request a permanent section swap. However, because this form only allows you to request a new section by time (not location), if you would like to request a swap to a specific section for pair programming reasons, please email Nick, the Head TA.

There is also a link under "Sections" to a list of all section times and locations, and a link to drop your section if you decide to unenroll from the class (this is important, as it allows another student to potentially take your section spot!).

The deadline for section swaps is Tuesday, 1/24, at 5PM.

LaIR Helper Hours Started Monday 1/16

We apologize for any confusion in class today about when LaIR helper hours start. To clarify, because of the 3-day weekend, the LaIR will be open in the Tresidder food court area starting on Monday 1/16. From then onwards, the LaIR will be open from 6PM-12midnight Sunday - Thursday. Come by if you need help with your first assignment, or if you have any conceptual questions!

Martin Luther King, Jr. Day

Reminder that tomorrow, Jan 16th, is MLK day so there will be no classes. LaIR office hours will start the evening of Monday, Jan 16th.

Here is a video of the last public speech MLK gave. The date was April 3, 1968 and he was assasinated the day after. Civil rights for all people, regardless of their ethnicity, is a cause that is still being faught for around the world.

Of course if you haven't seen the I Have a Dream Speech, that is worth watching for its beautiful narrative and its influence on history.

Section Signups Open Until 5PM Sunday 1/15

Section signups are now open! Click on the "Section" tab at the top and select "Sign up for section" to submit your preferences. As a reminder, signups are not first come first serve. As such, you may modify your preferences any time up until the Sunday 5PM deadline. We will notify you of your section assignment early next week.

Note: Remote SCPD students (if you are an SCPD student but able to attend a section on campus, you may disregard this message) should sign up for the special "SCPD Section" in the section preferences form. Remote SCPD students will not be assigned a physical section; instead, you will have access to online recordings of one section this quarter, and another assigned Section Leader to grade your assignments.

First Assignment: Karel

For your first assignment you will write a series of Karel the Robot programs. See the assignment page for more details. The assignment is due Friday, Jan 20th, but make sure to get started early. Though Karel is a fun, simple robot, some of the questions can take a lot of time.

Download Eclipse

In CS106A we use a free, "development environment" called icon Eclipse to write our programs. It is the most popular development environment for the Java language. Download eclipse by following these instructions.

There will be an Eclipse installation trouble shooting session Friday the 13th of Jan, 3pm to 5pm in Hewlett 200. Try to install Eclipse before and come if you have any trouble.

Who are you?

We have a very simple google form for you to fill out so that we have a chance to get to know you a little. It should only take a few minutes. Though we call it "assignment 0" it is not for a grade.

What is CS106A?

We put together some handouts to help you understand where we are going to go in CS106A and how we plan to get there. See the General Information handout for details on logistics and the Course Placement handout to help you decide if CS106A is the right place for you.

The Course Schedule page shows you the topics that we are going to cover in CS106A and the corresponding readings. We will also post lecture slides and lecture code on the schedule page.


Welcome to CS106A! We are looking forward to a fun quarter. Class starts Monday Jan 9th at 10:30am in NVIDIA Auditorium.