CS 145 Lab 3

Our variables aren’t just simple numbers anymore. We’ve got complex objects like String and Scanner at our disposal. Today we’ll give you some more practice at using objects that others have made available. Reminder Be sure to get your checkpoints from lab 2 checked off in the first 20 minutes of this lab. They should […]

CS 145 Lecture 3

Agenda String Scanner objects vs. primitives methods vs. operators a bunch of common String methods KML Code StringFun.java package lecture; import java.util.Scanner; public class StringFun { public static void main(String[] args) { char letter = ‘a’; String alphabet = “abcdefghijklmnopqrstuvwxyz”; int sizeOfAlphabet = alphabet.length(); System.out.println(sizeOfAlphabet); Scanner in = new Scanner(System.in); // System.out.println(“Enter something, NOW: “); […]

CS 145 Lab 2

This lab builds on your readings and lecture discussion of variables and arithmetic operators. We’ll also see two new types, Scanner and String. Before you get started: Load the workspace you made last lab. It should be on your H: drive — not C:. Make a new package named lab2 in your cs145 project. Reminder […]

CS 145 Preassignment 1 – due before Friday, 9/23

See the PDF. Download speccheck_pre1.jar. Internet Explorer has an annoying habit of renaming this file. Make sure it ends in *.jar and not *.zip.

CS 145 Lecture 2

Topics Covered Can we break the paperclip chain record? Boolean The nature of primitive types Switching between types Penny-based RAM Higher-level operations in the Math class Calculating cow-path savings What does this do? int a = 7; int b = 3; b = a + b; int i; System.out.println(i); int i = 100; System.out.println(i / […]

CS 145 Lecture 1

Topics Covered Hi Computer science is the study of process Variables Assignment operator Arithmetic operators Code MathFun.java package lecture; public class MathFun { public static void main(String[] args) { System.out.println(5 + 5); System.out.println(5 – 100); System.out.println(5 * 100); System.out.println(5 / 100); double taxRate = 0.055; double costOfPaulsBikeTire = 26.0; System.out.println(26 + 26 * 0.055); System.out.println(26 […]

CS 145 Lab 1

Welcome CS 145 is a class where you learn to teach machines. You won’t just use them. You’re going to become a developer. Unlike the natural and social sciences, computer science and programming are not topics addressed in many of our schools. Let’s take a moment to describe what we computer scientists do with each […]