ENGR 131: Elementary Computer Programming

Prof. Michael Branicky

Case Western Reserve University


General Information

Information Sheet

Lecture Hours: MTWR 10:30-11:50am, Olin 313

Course Instructor: Michael Branicky, mb [æt] case [daat] edu, Glennan 327, x2802
Instructor's Office Hours: MTWR 12-1pm

Required Text
Detailed Syllabus

Website

http://dora.case.edu/msb/131-summer11

Announcements

Lectures [and Assigned Reading]

06 JUN: Lecture 01: Course Mechanics / Intro / HTML [Liang 1.1-4]
eHandouts: Reasons #3, #47, Intro to HTML (by Savitch), Savitch's Simple HTML File, helloworld.html, Example Home Page
07 JUN: Lecture 02: Compiling/Running Programs / LA0 due [Liang 1.6-11]
Handout: Hello, World! <- Print and bring to class
Programs to check out: HelloWorld.java, helloworld.c (C), helloworld.cc (C++), helloworld.m (Matlab), helloworld.py (Python), WelcomeInMessageDialogBox.java

Review Questions [from Liang]: 1.8, 1.11-17

08 JUN: Lecture 03: Data Types and Declarations / PS0 due [Liang 2.1-2.7.2, 2.13, 1.5]
Handout: Notes <- Print and bring to class
Programs to check out: TemplateProgram.java, Average1.java, Average2.java, DeclareAndPrintDemo.java, FormattedTextDemo.java, ScannerDemo.java
Review Questions [from Liang]: 2.1-6, 2.8-10, 2.12-13
09 JUN: Lecture 04: Expressions and Operators / Math Class / LA1 due [Liang 2.7.3, 2.8-2.12, 2.14-2.15, 5.9, Math Class documentation]
eHandouts: Problem to Program: Wind Chill, Rolling a Die in Java
Programs to check out: Average3.java, Arithmetic1.java, Arithmetic2.java, MathDemo.java, WindChill.java
Review Questions [from Liang]: 2.14-16, 2.17, 2.19, 2.22, 2.26-29, 3.14-15


13 JUN: Lecture 05: If-Else / Logical Operators / PS1 due [Liang 3.1-3, 3.6, 3.7]
Power-of-if Links: Stimulus-Response Agents, iRobot's Roomba, DARPA Urban Challenge
Programs to check out: WindChill2.java, IfDemo.java, IfElseDemo.java, WindChill3.java
Review Questions [from Liang]: 3.1-5, 3.10-13
14 JUN: Lecture 06: While / Assignment Operators / LA2 due [Liang 4.1-2, 2.7.4]
Power-of-while Links: While in Battle, While in Action
Programs to check out: NaiveRepeat.java, RepeatN.java, RollDieUntilConfirm.java, WindChillWhile.java

15 JUN: Lecture 07: For Loops / PS2 due [Liang 4.4-6]
Power-of-for Links: For in Action, For Challenges
Programs to check out: NestedLoops.java
Review Questions [from Liang]: 4.4-5, 4.8 (convert to while only), 4.16 (lines 1-14 only), 4.17

16 JUN: Lecture 08: Nested Loops / Loop Analysis / LA3 due [Liang 4.7-8]
Programs to check out: NestedLoops2.java, NestedLoops3.java, DieSums.java, CountDemo.java, CountTimeDemo.java, PrimeTester.java, Grid.java
Review Questions [from Liang]: 4.18a-c, 4.19

20 JUN: Lecture 09: Class Methods I / PS3 due [Liang 5.1-5]
Programs to check out: turtlefun.py, MethodsDemo.java
Review Questions [from Liang]: 5.1, 2, 6, 7, 9
21 JUN: Lecture 10: Class Methods II / Procedure Abstraction / LA4 due [Liang 5.6, 8-11]
eHandout: Procedure Abstraction
Programs to check out: TestMax.java, WhileMethods.java, ForMethods.java, Weather.java, Weather2.java, Peculiar.java
Review Questions [from Liang]: 5.10, 11, 13, 15-18

22 JUN: Lecture 11: Arrays I / PS4 due [Liang 6.1, 6.2 (not 6.2.7), 6.3 (only one-by-one method)]
Programs to check out: MaxMinAvg.java, DiceStats.java
Review Questions [from Liang]: 6.1-9
23 JUN: Lecture 12: Arrays II / LA5 due [Liang 6.4-5, 6.7, 6.8.1, 6.10 (not 6.10.3), 6.11]
Programs to check out: ArraysDemo.java, Robots.java, TicTacToe.java
Review Questions [from Liang]: 6.12, 13, 17, 18, 25, 27, 28

27 JUN: Lecture 13: Files I / PS5 due [Liang 8.7, 8.8]
eHandout: Files, or Places to Put Your Stuff
Programs to check out:
TestFileClass2.java
ReadFileTrial.java   (to run, also download MadlibDataTrial.txt)
ReadFile.java   (to run, also download MadlibData.txt)
WriteFile.java
PrimeFinder2.java
GLRatings.java   (to run, also download u.data [1.9MB])
Review Questions [from Liang]: 8.25-31
28 JUN: Lecture 14: Files II / LA6 due
Reading:
Stepwise Refinement / Iterated Development
Program Development Plan (excerpted from How to Think Like a Computer Scientist: Java Version by Allen B. Downey)
Image File I/O in Java
Programs to check out: ColorFun.java
OLD "PS7": PS7   Best of PS7

29 JUN: Lecture 15: Cleanup / Review for Midterm Exam 1 / PS6 due
Review Problems eHandout (print and bring to lecture)

Some extra programs to check out: SimpleIO.java, SimpleFlow.java, SimpleMethods.java

30 JUN: Lecture 16: Midterm Exam 1 (in class; covers Lectures 1-10; PS 1-5)

04 JUL: INDEPENDENCE DAY HOLIDAY (No Class)
05 JUL: Lecture 17: Exam Recap / Strings / LA7 due [Liang 8.2, entire section except for intern in 8.2.2 and regionMatches on page 265]
Selected String class methods, String class documentation
Review Questions [from Liang]: 8.1, skipping (7); 8.3-6
Programs to check out: Palindromes.java

06 JUL: Lecture 18: Objects and Classes I / PS7 due (200 pts!) [Liang 7.1-7.4.2]
What Is an Object?, What Is a Class?
Review Questions [from Liang]: 7.1-2
Programs to check out: Circle.java, CircleTest.java, Robot.java, RoboWorld.java
07 JUL: Lecture 19: Objects and Classes II / LA8 due [Liang 7.3-7.4, 7.6]
Review Questions [from Liang]: 7.2, 7.10, 7.11

11 JUL: Lecture 20: Objects and Classes III / PS8 due [Liang 7.7-12]
Review Questions [from Liang]: 7.13, 7.14, 7.15, 7.22
Programs to check out: CircleTest2.java
Case study: Liang's Problem 7.4
12 JUL: Lecture 21: Objects and Classes IV / LA9 due [Liang 7.13-17]
Programs to check out: Movie.java
Case study: Complex Class Problem (Solution that we developed in lecture: Complex.java)
Case study: IntegerSet Class Problem (Solution: IntegerSet.java, IntegerSetTest.java)

13 JUL: Lecture 22: Inheritance / Intro. to GUIs / PS9 due [Liang 9.1-5; 12.1-4]
Review Questions [from Liang]: 9.1,3,4; 12.3-5
Programs to check out: Parent.java, PayMovie.java, PG13Movie.java
eHandouts: GUI Components
Programs to check out: GUIComponents.java
14 JUL: Lecture 23: Cleanup / Review for Midterm Exam 2 / LA10 due
Review Problems eHandout (print and bring to lecture)
Java Reference Sheet eHandout (print and bring to lecture)

Some extra programs to check out: ClassInstanceExample.java, GetAndSetExample.java


18 JUL: Lecture 24: Midterm Exam 2

19 JUL: Lecture 25: GUIs [Liang 12.5, 14.1-2, Table 14.1, 14.3.3, 14.4 (mouse)]
Review Questions [from Liang]: 12.7-9, 14.10
Programs to check out:
GUIComponents.java,
Addition.java,
Histogram.java, HistogramTest.java,
Liang's TestActionEvent.java,
Liang's Exercise14_4.java
20 JUL: Lecture 26: Applets / PS10 due [Liang 16.1-4, 7, 8]
HTML Review:
Intro to HTML (by Savitch), Savitch's Simple HTML File, helloworld.html, Example Home Page
Applets to check out:
First, see those in Useful/Fun Links section below
HelloWorldApplet.java, HelloWorldApplet.html
Loan.java, LoanApplet.java, LoanApplet.html
TicTacToe.java, TicTacToe.html
Ball.java, BallControl.java, BounceBallApp.java

21 JUL: No Class / LA11 due


25 JUL: Lecture 27: JavaScript and Other Languages / Recap / PS11 due
Prof. Branicky's Tower of Babel
Other Languages
JavaScript Examples
JavaScript BMI Calculator
JavaScript eHandout

Final Exam Information Sheet
Programs You Wrote
Movie Clips

Best of PS7 Contest   (JavaScipt version)

26 JUL: Lecture 28: Matlab I / LA12 due
Octave Session from Lecture
27 JUL: Lecture 29: Matlab II
Interactive Lecture Session
28 JUL: Lecture 30: Review for Final Exam / PS12 due
Review Problems eHandout (print and bring to lecture)
Java Reference Sheet eHandout (print and bring to lecture)

01 AUG: Lectures 31-32: COMPREHENSIVE FINAL EXAM (9am-noon)
FinalApplet11.java, FinalApplet11.html


Code Repository

Multi-Media Tie-ins

if-else: Red Pill or Blue Pill? (from Matrix)
while: Grond--Hammer of the Underworld (from LOTR: The Return of the King)
for: Repeating Smiths (from Matrix Reloaded, 1:50-2:33)
nesting loops: Nesting Dolls
methods: Talking Turtle with Seymour Papert
1-d arrays: Street Writer
2-d arrays: Sonny Hiding in the Factory (from I, Robot)
3-d arrays: Cubicle Farm (from Futurama, 0:48-1:23)
files i: Scrat's Stash (from Gone Nutty / Ice Age, until 1:04)
files ii: Central Bureaucracy Filing Song (from Futurama)
strings: Chevron string (from Stargate, 3:49-6:49); also see Stargate Symbols
exams/final: Good Luck!

How To Submit Lab Assignments and Problem Sets

Lab Assignments

Lab Assignment 0
Lab Assignment 1
Lab Assignment 2   FAQ
Lab Assignment 3
Lab Assignment 4
Lab Assignment 5
Lab Assignment 6
Lab Assignment 7 (Worth: 30 points!)
Lab Assignment 8
Lab Assignment 9
Lab Assignment 10   Notes
Lab Assignment 11   Notes
Lab Assignment 12

Problem Sets

Problem Set 0   FAQ
Problem Set 1   FAQ
Problem Set 2   FAQ   Notes
Problem Set 3   FAQ
Problem Set 4   FAQ   Notes
Problem Set 5   FAQ   Notes
Problem Set 6   FAQ   Notes
Problem Set 7 (Worth: 200 points!)   FAQ   Notes
Problem Set 8   FAQ
Problem Set 9   FAQ   Notes
Problem Set 10   FAQ
Problem Set 11
Problem Set 12

Pop Quizzes

Pop Quiz 1 (Lecture 06)
Pop Quiz 2 (Lecture 08)
Pop Quiz 3 (Lecture 13)
Pop Quiz 4 (Lecture 20)
Pop Quiz 5 (Lecture 23)
Pop Quiz 6 (Lecture 27)

Midterms / Final

Midterm Exam 1 (R, 30 JUN, in lecture)
Information Sheet   Post-Mortem
Study Materials:
    Java Reference Sheet
    Review Problems Handout from Lecture 15
    Sample Exam from Fall 2007 and Model and Post-Mortem
    Sample Exam from Fall 2006 and Solutions and Post-Mortem
    Sample Exam Problems from Spring 2006 and Solutions
    Self-Test Questions with Answers
Midterm Exam 2 (M, 18 JUL, in lecture)
Information Sheet   Post-Mortem
Study Materials:
  Java Reference Sheet
  Review Problems eHandout from Lecture 23
  Sample Exam from Fall 2007 and Solutions and Post-Mortem
  Sample Exam from Fall 2006 and Solutions and Post-Mortem
  Sample Exam A from Spring 2006 and Solutions
  Sample Exam B from Spring 2006 and Solutions
  Self-Test Questions with Answers
Final Exam (M, 01 AUG, 9am-noon, Glennan 313)
Note: our final will be longer than each midterm and comprehensive (unlike the Sample Exams provided below)
Information Sheet
Study Materials:
  All the materials for Midterm Exam 1 above
  All the materials for Midterm Exam 2 above
  Java Reference Sheet
  Review Problems eHandout from Lecture 30
  Sample Exam A from Spring 2006 and Solutions
  Sample Exam B from Spring 2006 and Solutions
  Self-Test Questions with Answers
FinalApplet11.java, FinalApplet11.html

Useful/Fun Links

Course Resources
Companion Website for Liang's Intro to Java: Fundamentals First
Liang's Supplements

Team Case Urban Challenge site; Photos of Dexter
PathCase Bioinformatics Tool; System/Pathway Figures

Extra HTML Links
HTML Code Tutorial
Quick List of Tags, with Examples

Downloading DrJava [and Java (JDK 5 or 6)]
DrJava development environment
Installing Java and DrJava on your own machine
If you wish, you can also look Liang's Supplement VI-A (follow link to Supplements in "Course Resources" above)

WikiHow: How to Say Hello in Different Languages
Altavista's Babelfish
WikiBooks' collection of hello world programs
Prof. Branicky's Tower of Babel

Why Java?
Java in cars and on Mars
Applets
Minesweeper
John Conway's Game of Life
Example Applets
Libraries, graphical interfaces (2-D and 3-D)
Java API documentation
[see Liang 1.11] JOptionPane Class documentation (first hit on Google using [JOptionPane], 06/23/2011)
Java 3D enabled CAVE: Goto Visual Genomics, also, then click on "Resources -> CAVE"
Articles about Java Technology

Average
Donald Knuth (Case, Class of 1960; arguably the most famous computer scientist of all time)
Bits, Bytes, and all that
Hex to Decimal and Binary Converter
ASCII Conversion Table

Mathworld: Sphere
Math Class documentation

Talking Turtle with Seymour Papert
Python Turtle Tutorial
Python Turtle graphics library
Main Python Site:   documentation   |   download

DrJava Debugger
Weird Debugger Behavior (Buttons grayed out? Exits?):
Try "Reset", "Debug Mode", "Run". Alternatively, use java classname in the Interactions Pane.
Note: You can debug single methods (other than main). Use classname.methodname(methodargs)

Lesson: Working with Images
Graphics file format summary
500 RGB and HEX color codes
More RGB and HEX color codes

Netflix Prize: Home

String Class documentation
Unicode Charts,   Basic Latin Chart

SimCity Societies
YouTube
Period Table of Elements: Simple, More Complete, Same but Bigger

Class JFrame Documentation
Class Graphics Documentation

JavaScript Demos
JavaScript Tutorial
JavaScript Examples

Matlab Primer (for internal use only) [ pdf | html ]
Kamen and Heck's Matlab Tutorial [ pdf | html ]
Other Matlab tutorial links:
MIT
Stanford
TUE
MTU
MIT 18.06 Matlab Cheatsheet
Other Matlab Cheatsheets


© Michael S. Branicky