teaching machines

Half-homework 2 – Methods – due October 7

Your objective in this homework is to make code self-contained and reusable using methods. You will do this in the context of solving several disconnected problems that have no overarching story. Sorry. Breaking code up into methods has several benefits: it enables large problems to be decomposed into smaller, mind-sized bytes; methods with a distinct […]

Half-homework 1 – Maintenance – due September 23

Your objective in this homework is to acquaint yourself with the world of mathematical calculation using a programming language. Math in code is a little different than the calculator math you are used to in the following ways: Programmers make considerable use of variables, whose names tend to be longer and more meaningful. Numbers are […]

Homework 0 – The Git Sandwich

For homework 0, you gained access to your homework repository on GitLab, cloned it on your local machine, and pushed those local changes back up to GitLab. In this installment, you will learn to synchronize in the other direction—you will pull changes down from GitLab to your local repository. Pulling Suppose you’re home for the […]

Homework 0 – Updating SpecCheckers

Like you, your instructor is a human with finite supplies of time and energy. Errors inevitably creep into the SpecCheckers, whose JAR files are sitting in your cloned repository. Your instructor will fix the errors, but how do you get the fixes into your repository? A decade ago you would download the updated JAR files […]

Homework 0 – Goodbye, Pluto

Your task in this homework—which is worth no Blugolds—is to set up your repository and IntelliJ IDEA project and to acclimate yourself to the SpecChecker grading tools. GitLab You are probably used to two kinds of systems for editing and managing files. Some tools are installed on your local machine and edit files stored on […]

CS 1: Final Exam

See the PDF.

CS 1: Lecture 38 – Binary Search

Dear students, We close our semester today with a discussion of finding things quickly with the binary search. We will illustrate the algorithm and implement it in the context of a dictionary/spell-checker. Earlier in the semester we discussed the linear search. Let’s revisit that algorithm first by locating a spice in our spice rack. What […]

CS 1: Lecture 37 – Lights Out

Dear students, It’s the last week! Given that we’re all stressed and ready to be done, let’s play a game today. Just kidding, let’s make one instead. We’re going to implement Lights Out, which started off as a handheld game from Tiger Electronics: The game is played on a 5×5 grid of lights, some of […]

CS 1: Lecture 36 – Unit Testing

Dear students, Today, we examine one of the less glamorous aspects of writing code: testing it. There are three big reasons to write systematic tests of your software: To make sure that your code does what you think it does. To expand your thinking into situations outside your normal parameter ranges and workflow. To ensure […]

CS 1: Lecture 35 – Implementing a Growable Array

Dear students, Today, December 6, is National Growable Array Day. We will celebrate growable arrays everywhere by growing one of our own growable arrays, right here, in our classroom. I hope you wore your festive gear. Behind every growable array is an plain old ungrowable array. When that ungrowable array gets filled up, a new […]

1 6 7 8 9 10 15