teaching machines

CS 145 Lecture 16 – Logic Cont’d Cont’d

Dear students, In the late 1800s, logician John Venn invented a diagram for showing ideas of logic. He writes: I began at once somewhat more steady work on the subjects and books which I should have to lecture on. I now first hit upon the diagrammatical device of representing propositions by inclusive and exclusive circles. […]

CS 145 Lecture 15 – Logic Cont’d

Dear students, We’ve had an exam, which is mostly graded but not quite. I will hand them back in lab next Tuesday so that you have time to ask questions. Instead, we will carry on with our discussion of the logical operators. Let’s start with some Blackboxes: Blackbox #1 Blackbox #2 Blackbox #3 Then, let’s […]

CS 145 Lab 5 – Logical Operators

Welcome to lab 5! If you have checkpoints from the last to show your instructor or TA, do so immediately. No credit will be given if you have not already completed the work, nor will credit be given after the first 10 minutes of this lab. You must work with a partner that you have […]

CS 145 Lecture 14 – Logical Operators

Dear students, Our computer can now ponder our data. It can examine order and equality, two operations at the root of all decision making. Before we sign up for something, we ask ourselves if the benefit exceeds the cost. We compare two brands of pasta on price and weight. We scan the details of our […]

CS 145 Lecture 13 – Relational Operators

Dear students, Based on your quarter sheets on the frankenstring problem, I think we need to take a moment to recommend a thinking strategy when someone asks you to write a method. Here’s how to tackle such a problem: Listen to problem description just enough to determine what kind of data your method is supposed […]

CS 145 Lecture 12 – Test-driven Development

Dear students, Last lecture I said we’d have one more day of focus on methods, but then we spent the entire time talking about casting. Today we’ll start the fill-in-the-blank exercises to exercise our method brain. Your task is to jot what goes in each blank of the following code snippets. One of the blanks […]

CS 145 Lab 4 – Methods

Welcome to lab 4! If you have checkpoints from the last to show your instructor or TA, do so immediately. No credit will be given if you have not already completed the work, nor will credit be given after the first 10 minutes of this lab. You must work with a partner that you have […]

CS 145 Lecture 11 – Methods x4

Dear students, Let’s do one more of the exercises from last time! Middle public class Middle { public static void main(String[] args) { char a = ‘a’; char e = ‘e’; char middle = average(a, e); System.out.println(middle); } public static char average(char c1, char c2) { return (c1 + c2) / 2; } } This […]

CS 145 Lecture 10 – Methods and Memory

Dear students, Whoever you are, you need practice with methods. They are a concept that you probably didn’t encounter in your high school math classes, and you have no prior knowledge on which to build here. So, don’t be too hard on yourself if they don’t click immediately. Today, then, we devote our entire time […]

CS 145 Lecture 9 – Blackboxes

Dear students, We have seen methods as a means of capturing a process into a reusable component. Methods have some really nice advantages: They drop us into a smaller world with a smaller problem to solve. Instead of thinking about the grand mission of our program, we think about the baby step of the method. […]

1 2 3 4 5 6 7