December 2010
4 posts
Review Questions: Answers
Here are my written up answers to all of the review questions covered Thursday during the lab session and on Friday in class: Review Question Answers. (I fixed a small typo and re-uploaded this document on Friday, 12/3 at 7:30pm - if you downloaded it before then, get the updated version!) My commitments next week are next Wednesday, a meeting from 2:30 to 4:00’ish, and then it also appears...
Dec 3rd
Test 3 (Final Exam)
Here is the study guide, with a few practice problems, for the final exam.  The final exam is scheduled for Friday, December 10th at 2:00pm in Manchester Hall Room 241 (our normal classroom).
Dec 2nd
4 notes
Wednesday, 12/1/2010
In lecture today, recursion was continued, as well as a period for course evaluations. The main recursion points covered were: additional math sequences & series defined recursively viewing arrays in a recursive way (head element, tail subarray) an overview of the relationship between loops and recursion thinking about what is going on behind the scenes in recursion when it is running ...
Dec 1st
Monday, 11/29/2010
In lecture on Monday, recursion was introduced, including the following topics: the general notion of recursion & recursive functions fractals (self similar images) and how recursive functions can draw fractals math operations/series/sequences based on recursion Here are the lecture notes. Here are the various circle fractal programs we looked at: Bullseye Left & Right Circles ...
Dec 1st
November 2010
15 posts
Monday, 11/22/2010
In lecture today, we discussed the notions of compilation and interpretation - techniques to translate from high level programming languages like Processing to the binary language CPUs can understand and execute.  Here are the notes from today.
Nov 22nd
Friday, 11/19/2010
In lecture, we worked on the lab from the previous day, focusing mainly on the CommissionedEmployee class.
Nov 22nd
Lab 11, 11/18/2010
In today’s lab, you will be writing a program that employs inheritance and file input. Here are the files you will need: Lab 11 Manual Employee.pde PaycheckPrinter.pde employees.txt It will probably be pretty useful to look at the BankAccount/SavingsAccount files below during the lab, as they are examples of the relationship we will be trying to build between an Employee class and its...
Nov 18th
An Example of Inheritance
Here’s code providing an example of inheritance using BankAccount and SavingsAccount.  The various nuances of the inheritance syntax should all be present here.  The file SavingsAccount.pde has a number of comments explaining what exactly the different syntax and functions are doing. BankAccount.pde SavingsAccount.pde BankProgram.pde Lab #11 documents will be posted tomorrow (Thursday)...
Nov 18th
Wednesday, 11/17/2010
In lecture today, we covered the following topics: Reviewed the latest quiz (I will post the key soon) Discussed inheritance in more detail, particularly focusing on designing inheritance hierarchies and the syntax for inheritance Here are the notes from Wednesday.
Nov 17th
Monday, 11/15/2010
On Monday, the following topics were covered in lecture: Processing input/output Java input/output (the “behind-the-scenes” of Processing) the notion and key concepts behind the idea of inheritance Here is a PDF of the slides that were presented. Example code: Handling files in Processing (loadStrings, saveStringS): Files.pde, studentNames.txt (the file of student names read in...
Nov 16th
Friday, 11/12/2010
In lecture Quiz #6 was taken, followed by discussion of lab problems #3 and #4.
Nov 14th
Lab 10, 11/11/2010
In lab today, you will be writing four programs that make use of the String class provided by Processing. Here are the lab documents: Lab 10 Manual PasswordChecker.pde ImprovedPasswordChecker.pde StringReverser.pde NameFormatter.pde It will likely be pretty useful to look at yesterday’s slides and example programs (in the blog entry below) as you progress through this lab.
Nov 11th
Wednesday, 11/10/2010
In lecture today, the String class was the focus.  We primarily covered the functions available from the String class, though issues such as how to read a String from the user typing also came up. Documents from today: Powerpoint slides StringLengthAndCharAt.pde - Use of the length() and charAt() functions toUpperToLowerEquals.pde - Use of the toUpper(), toLower(), and equals() functions ...
Nov 10th
Monday, 11/8/2010
In lecture today, we: discussed the newly posted homework reviewed an example of how to take a problem description and design a class that represents the desired data for that problem (LibraryBook) discussed a FallingBoxes game program where the idea of the Box was abstracted out into its own class introduced the built-in String class Here are the slides from today.
Nov 8th
Assignment 10
Here’s Assignment 10, on classes and objects, which will be due Wednesday, November 10th at noon (start of class).  We will go over it either on Wednesday or Thursday.
Nov 6th
Friday, 11/5/2010
In lecture today, the following topics were covered: Reviewed Test #2 (I will post the key on Monday when I get back to campus) Explored a re-written Snakes program that made use of a Point class.. the files are included below: SnakeOOP.pde Point.pde I mentioned that one could re-write the FallingBoxes program, moving the idea of  a Box to its own class FallingBoxesOOP.pde Box.pde
Nov 6th
Lab 9
Lab 9 documents: Lab9Manual.pdf BankProgram.zip Lab 9 is due Tuesday, 11/9 at 6:00pm.  Upload the three programs into Sakai and submit the questions either on paper or via Sakai.
Nov 4th
Monday, 11/1 and Wednesday, 11/3
On 11/1 and 11/3, we began to introduce the idea of classes - that essentially we were defining our own new types to be used in Processing.  We have seen that defining classes involves: defining what types & variables make-up our class (for example, a Point is an integer x and an integer y coordinate) defining how a variable of one of our new types can be declared and created (Point p1 = new...
Nov 3rd
Friday, 10/29/2010
On Friday, 10/29, Test 2 was taken.
Nov 3rd
October 2010
16 posts
Wednesday, 10/27/2010
In today’s lecture, we went over a number of problems as practice that covered loops and arrays and which should/could be helpful for the upcoming test.  Here are my answers in a PDF document.   There will be no official lab tomorrow - we will hold a review session instead - please come with questions if you attend!
Oct 27th
Monday, 10/25/2010
In lecture today, the following topics were covered: Handed back Lab 5 and handed back and went over Quiz 5 Presented the Test 2 Study Guide, available here: Test2StudyGuideAndReview.pdf Discussed Lab #8, Problem 3… we also pushed the lab due date back one more day - to be due Wednesday, 10/27 by 6:00pm
Oct 25th
Friday, 10/22/2010
In lecture today, the following topics were covered: Addressed a few array questions pre-quiz Took Quiz #5 Worked on the 2nd part of Lab #8
Oct 25th
Lab 8, 10/21/2010
Here’s lab #8  - it is on arrays and for loops, and also makes use of 2-d arrays.  The due date is Tuesday, October 26th at 6:00pm.  Submit either on paper or via Sakai. Lab 8 document (PDF format) Programs to work with: Grades.pde Snake.pde ColorReplace.pde
Oct 21st
Wednesday, 10/20/2010
In lecture today, the following topics were covered: a code example of declaring and moving through a multi-dimensional array reviewed tic-tac-toe, which made use of a 3x3 2-d multidimensional char array - this used lots of functions that deal with the array (creating it blank, checking to see if a position has already been played, checking for a winner, checking for a tie, etc) introduced...
Oct 20th
Monday, 10/18/2010
In lecture today, the following topics were covered: Handed back several old assignments Discussed the “and” and “or” functions on the lab, specifically the last page where we re-write those functions to pass off the work (delegate the work) to the contains function Introduced multi-dimensional (primarily 2-d) arrays - why they could be useful, their syntax, and how to...
Oct 18th
Assignment #9
Here’s Assignment #9, on arrays, to be due Thursday, October 21st at the start of lab (3:00pm).  Submit via paper or upload into Sakai.
Oct 18th
Progress on Mid-Term Grades
Reposted from Sakai Announcements: I am slowly making progress on finalizing grades before the mid-terms.  My plan is to have everything ready to go by Tuesday evening so you can look at it before Wednesday when the mid-terms are due. Assignment #6, Lab #3, and Lab #4 are graded and will be returned tomorrow. I will work on Assignment 4 (the clock program tomorrow/Tuesday).    Labs #5 and #6 are...
Oct 18th
Lab 7 (10/14/2010)
Here’s lab #7  - it is on arrays, for loops, and also brings back up the ideas of OR and AND.  The due date is Tuesday, October 19th at 6:00pm.  Submit either on paper or via Sakai. Lab 7 document (PDF format) Programs to work with: Problem1.pde booleanArrayFunctions.pde Problem2.pde
Oct 14th
Wednesday, 10/13/2010
In lecture today, additional examples of arrays functions were reviewed or constructed by us.  Here are implemented Processing versions of the various functions discussed: arrayFallingBoxes.pde - the falling boxes game setup to use 3 boxes  arraySearchFunctions.pde - the ‘contains’ and ‘count’ functions gradeDistribution.pde - compute a grade distribution from an array...
Oct 13th
Monday, 10/11/2010
I plan to have midterm grades available by Sunday/Monday (they are due Wednesday of next week), both on WIN (a letter grade) and in Sakai (a numerical grade).   We will have lab on Thursday; we won’t have a quiz this week though since there is no class on Friday. In lecture today, the following topics were covered: Review of Quiz #4 More examples of using a for loop to solve array...
Oct 11th
Friday, 10/8/2010
In class today, the following topics were covered: review of Homework #8 Quiz #4 was taken discussion of how to write a for loop that visits all of the entries of an array, put in the context of an array of student grades (tying back to the lab) The code we looked at was the segments of instructions for looking for the smallest and largest grades in an array.  The code we looked at is here:...
Oct 11th
Lab 6 (10/7/2010)
Here’s lab #6  - it is on tracing, for loops, and arrays.  Due date is Tuesday, October 12th at 6:00pm.  Submit either on paper or via Sakai. Lab 6 document (PDF format) Programs to work with: ComputeLogs.pde PowerFor.pde GradesArray.pde
Oct 7th
Wednesday, 10/6/2010
Today in class we reviewed Homework #7, and then formally introduced the idea of arrays.  Below you will find a Prezi presentation that covers the array material. Arrays are Chapter 9 in the book.  Ignore the sections that discuss “Objects” as we have not encountered that material (we will soon!) Here are a few simple Processing programs that use arrays: arrayReadAndWrite.pde -...
Oct 7th
Monday, 10/04/2010
Here’s Assignment #8, on FOR loops, which is planned to be due Thursday, 10/7, at the start of lab. In class we discussed: shortcut operators (+=, -=, *=, /=, %=) increment/decrement operators (++, —) examples of for loops, including the design from scratch of a factorial function Here are the programs we saw as examples: drawAxisMarkersFor.pde - set up the axis markers (from lab...
Oct 4th
Friday, 10/01/2010
In lecture today, the following topics were covered: reinforcing the key components of while loops: initialize, test, and update the loop controlling variable a discussion of how things could go wrong with one of the above components and lead us into infinite loops additional examples of while loops a discussion of counting while loops vs other styles of while loops introduction of the...
Oct 2nd
Assignment 7
Here’s Assignment #7, covering while loops and variable scope/visibility, which will be due on Monday, 10/04/2010 by 6:00pm. Upload via Sakai or turn it in to my office (slide it under my door if I’m not there - I’ll stick around till 6:00 that evening!) Assignment 7 PDF
Oct 1st
September 2010
21 posts
Lab 5 (9/30/2010)
Lab 5 is now posted - it is on while loops.  Due date is Tuesday, October 5th at 6:00pm.  Submit either on paper or via Sakai. Lab 5 document (PDF format) Programs to work with: rectangleRow.pde nestedBoxesDraft.pde colorScaleDraft.pde
Sep 30th
Wednesday, 09/29/2010
In lecture today, the following topics were covered: a motivating example for why local variables are useful (we wrote functions that computed the area of a triangle specified by 3 points); in the example, the variables were used to hold “temporarily useful information” introduction of the idea of loops Here is the area-calculating program: triangleArea.pde Here is a program that...
Sep 29th
Monday, 09/27/2010
In class today, the following topics were covered: The graded tests were given back and reviewed.  Here is the key in PDF format. We expanded on the idea of “scope” and “variable visibility”.  Here is the example program we looked at: scopeExample.pde On Wednesday, we will finish up scope and start looking at “loops”.  If you want, feel free to go ahead and...
Sep 27th
1 note
Friday, 09/24/2010
Test 1 was taken on Friday, 9/24.
Sep 27th
Wednesday, 09/22/2010
In class today, the following topics were covered: We reviewed the answers to Assignment 6 (the key was passed out) We covered the Study Guide and its sample problems We addressed one person’s request for a review topic - how to write functions. The StudyGuide has the key topics to know, resources you may want to use, a few sample problems, and an overview of the discussion we had on...
Sep 22nd
Monday, 09/20/2010
In lecture today, the following topics were covered: Review of the most recent quiz on conditional execution Four clicker questions on conditional execution (logical & relational operators and the if/else statements primarily) Introduced a new homework, Assignment #6 Introduced the notion of variable scope, which we’ll continue after the test Here’s Assignment 6, and the...
Sep 20th
Friday, 09/17/2010
In class today, the following topics were covered: Quiz 3 was taken We reviewed the “else if” statement, and how it could be useful when we are evaluating a whole series of tests Time was spent working on the remainder of the lab Next Friday (9/24) is Test 1, so review will be 9/22 (come with questions!).  On Monday, we will likely continue with conditionals a little more.
Sep 17th
Lab 4 (9/16/2010)
Lab 4 deals with conditionals - Boolean expressions and the if/else statements. Here are the lab documents you will need: Lab 4 Manual Fetch It (Chaser/Target) Program Falling Boxes Game Program
Sep 16th
Wednesday, 09/15/2010; Assignment 5
Here’s Assignment #5.  Please submit it by tomorrow’s lab, either on paper or via Sakai. In lecture today, we covered the following topics: relational operators (<, >, <=, >=, ==, !=) logical operators (! (NOT), && (AND), || (OR)) ‘if’ and ‘else’ You will find the Prezi discussing these topics at the bottom of this post. Here are...
Sep 15th
Monday, 9/13/2010
In class today, the following topics were covered: Reviewed Quiz 2 & Assignment 4 Discussed some common errors that were being made in programs (such as overuse of types) Discussed the idea that many of our programs are very similar in style (almost all recent programs use variables as: declare up top, initialize in setup(), use & update variables in draw()) Introduced the notion of...
Sep 13th
Friday, 9/10/2010
In class today, Quiz 2 was taken and Assignment 4 was handed out.   Here is the PDF for Assignment 4.  Please submit it by Monday at the start of class.   We looked at two programs which are very similar in nature to what is needed for Assignment 4 and the lab solution.  They each exploit variables to allow the program to be very dynamic. Variables are declared at the top of the program,...
Sep 10th
Quiz Reminder
Remember there will be another quiz on Friday, very similar in format to the one last week.  The key topics are - types, return values, variables -.
Sep 9th
Lab 3 (9/9/2010)
Lab 3 deals with functions, types, and variables - using them to build a program that displays interest earned from simple investments (such as a CD [certificate of deposit]). Here are the documents you will need: Lab 3 Manual
Sep 9th
Wednesday, 9/8/2010
As prep for tomorrow’s lab, I would that it would be useful to: Review Sections 7.2, 7.3, 7.5, 7.7 on functions, as you will be designing your own functions in lab Read, for the first time I’m guessing, Sections 4.1-4.3, which is the material on variables - it should sync with what we talked about at the end of class today, and we will discuss it some at the beginning of lab...
Sep 8th