teaching machines

CS 1: Lecture 11 – Method Mechanics

Dear students, Sometimes Java is criticized for being verbose. But one of the great advantages of verbosity in a language is that a text reinforces itself. We may read a passage and not know every word, but there are often many clues lying in the context to help us determine their meaning. Java has these […]

CS 148: Lab 4 – Methods

Welcome to lab 4! If you have checkpoints from the last lab 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. Our goal today is to learn more about […]

CS 1: Lecture 10 – Blackboxes

Dear students, Let’s start with a little game called Blackbox! Write on paper a method that takes 1+ parameters. For the body of the method, compute a simple value based on the parameters. Have it return the value. For example, I might write this mysterious method: public static int mystery(int x) { int value = […]

CS 396: Meeting 3 – Resume Reviews

Dear students, Today Alyssa and her colleagues from Career Services will help us review resumes. Here’s your TODO list for next time: If you registered, attend the career breakfast on Thursday morning. Check in with me after you’ve met some employers, and I’ll credit your participation. I strongly encourage you to attend the larger career […]

CS 1: Lecture 9 – Return Values and Parameters

Dear students, Last time we saw how methods capture 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. They can […]

CS 145: Lab 3 – Methods

Welcome to lab 3! If you have checkpoints from the last lab 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. Work with a partner that you have not […]

CS 1: Lecture 8 – Methods

Dear students, First, let’s a new data type to our repertoire: a random number generator. If I tell you that the name of this type is Random, could you create a new variable that is capable of generating random numbers? You should be able to. We can tell by its capitalization that it is a […]

CS 148: Lab 3 – String and Math

Welcome to lab 3! If you have checkpoints from the last lab 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. Work with a partner that you have not […]

CS 1: Lecture 7 – String Cont’d

Dear students, With Strings at our disposal, our programs are going to start to feel human. We can write programs that process and generate words, and that’s pretty amazing! But we need more practice using them before we determine the authenticity of Shakespeare’s works. Let’s play some Stringo! Generate a String of five characters. Use […]

1 2 3