BIT 142:Intermediate Programming (2007 Fall)
Lessons

Table of Contents
Lesson 01 Lesson 02 Lesson 03 Lesson 04
Lesson 05 Lesson 06 Lesson 07 Lesson 08
Lesson 09 Lesson 10 Lesson 11 Misc. / Unused

OVERALL FEEDBACK:

  • More code-samples / better links to examples
  • Make sure that starter projects (For PCEs) are consistent with the required format for them to hand stuff in - Early on, perhaps just gving them starter projects to fill out?  later on - just the 'suggested format' docs
  • Idea: Include the pre/post test stuff in the assignments better, and stress that it's a 10 point penalty for not doing EACH ONE.  The assignments should START with the Pre-test, which is submitted immediately,
    and END with the post, which is to be done afterwards.

 

Lesson 01
 
Individual Pre-Class Exercises:
<Due:
Sept 29th at noon PST (FRIDAY of the FIRST week of the class) >
  1. Orient yourself to BIT 142
  2. Get Visual C#
  3. Join the class newsgroup ; Send the professor your email address (Required)  
     
  4. Create a simple console application  (Hand-In) (Ch 3.3 (walkthrough), 3.2 (explanation of the program) )   Demo Video
  5. Basic Console I/O     (Sect. 3.5)
  6. Basic Arithmetic Operators (Sect. 3.6, 3.8)
  7. Comparison Operators (Sect. 3.9)
  8. Defining & Using an Instance Method (Sect. 4.1-4.3 (mostly 4.3))
  9. Single-file Demo for PCE's (Sect. 4.1-4.3 (mostly 4.3)) (You need to do this, and use this as the 'template' for the exercises you do after this point)
  10. Function Calls: A Handy Trick (on your own)
  11. Data Types (Hand-In) (Sect. 5.11, Appendix L)
  12. Order Of Operations (Hand-In) (End of Sect. 3.9, Appendix A)
  13. Console I/O, Operators (Hand-In) (previous readings)
     
  14. String Basics (Sect. 16.2) (Hand-In)
  15. Comparing Strings (Sect. 16.5)
     
  16. Email the instructor (MPanitz@cascadia.edu) with your Cascadia username, so that the instructor can create your Vault account.
     
  17. Upload.php: How to hand in your pre-class exercises and homework
     
  18. PCE Feedback (Hand-In) (This will be graded)
In-Class Exercises:
<Class Date: Sept 24th  (Monday) >
(This class meets from 5:45-10:05pm this first week ; it meets from 5:45-7:50pm thereafter)

Review:

  1. Create a simple console application (Ch 3.3 (walkthrough), 3.2 (explanation of the program) )  Demo Video
  2. How to hand in pre-class exercises and homework
  3. Defining & Using an Instance Method
  4. Single-file Demo for PCE's (Sect. 4.1-4.3 (mostly 4.3)) (You need to do this, and use this as the 'template' for the exercises you do after this point)
  5. Basic Console I/O

Preview:

  1. % operator
  2. integer division
  3. Different types of loops
  4. nested loops

Feedback: explain classes and methods at the beginning, they are the crucial link to understand other statements

Instructor's Materials:
Notes
Slides

 

Lesson 02

 

Individual Pre-Class Exercises:
<Due:
Oct 1 (Monday)  at noon PST >
  1. C# Intro: Namespaces

  2. Integer vs. real division (End of Sect. 5.6, also Sect. 3.8) (Hand-In) (Demo Video   VS Project Used in the Video  (How to access demo projects) )
  3. Modulus operator ( % ) (Section 3.8) (Hand-In)    (Demo Video)
  4. Fahrenheit to Celsius (Based on your previously acquired knowledge) (Hand-In)
     
  5. Logical operators (Section 6.8)  Update: Instead of including a separate Word document, put your answer in comments in your C# source code file.
  6. if ; if ...else  ; switch statements (If: Sect. 5.3 / If...Else: Sect. 5.4) (Hand-In)
     
  7. Simple loops - while, for (Sect. 5.5)
  8. keywords: break / continue (Section 6.7)
     
  9. Compound Assignment operators (Section 5.9), Increment / Decrement operators (Sect. 5.10)
     
  10. Generating Random Numbers (Sect. 7.9 (Shift/scale: 7.9.1)) (Hand-In)
     
  11. Post at least 1 question in the Google Group for this class.
    Answer at least 1 question (that someone else has posted) in the Google Group for this class
     
  12. PCE Feedback (Hand-In) (This will be graded)
In-Class Exercises:
<Class Date:
Oct 1 (Monday) >

 

Review Topics:

  1. Q+A: Remainder ('Modulus') operator
  2. Q+A: Integer division

Preview Topics:

  1. Random # basics   Demo File
  2. Random numbers, manually bounded   (Demo File)
    ALSO: Go over non-integer random numbers!  - Random.nextDouble
     
  3. Basic parameter review
  4. Reference Parameters (out, ref) , and normal return values
     
  5. Nested Loops: Rectangles
     
  6. Overview of the MS-XNA grant

Warning: Don't worry about the recursion section (Sect. 7.13) - we'll see that in more detail later on

Instructor's Materials:
Notes
Slides

 

Lesson 03

 DUE: Assignment 1 (Due Monday, October 8th)

Individual Pre-Class Exercises:
<Due: Oct 8th (Monday)
 at noon PST >

  1. Sentinel-controlled loops: Averaging numbers (Sect. 5.7) (Hand-In)
     
  2. Nested Loops: Rectangles  (Sect. 5.8) (Demo Video   VS Project Used in the Video)
  3. Nested Loops: Hollow Rectangles (Sect. 5.8) (Hand-In)
     
  4. Printing A Range Of Numbers (Previous Knowledge) (Hand-In)
     
  5. Built-in Math functions  (Hand-In)  (Sect. 7.3)
     
  6. Basic Parameters (Sect. 4.4)
  7. Return Values (Sect 4.5 and 7.5 both have limited information.  Additional information is available at http://www.fredosaurus.com/notes-cpp/functions/return.html )
  8. Printing numbers, w/ params (Sect. 4.4)
     
  9. Reference Parameters (out, ref) , and normal return values  Sect. 7.14)
    For this PCE, you are encouraged to discuss this with your group.  Also, there may be multiple, valid interpretations of what a correct answer is for this exercise - you should focus on being able to clearly explain a reasonable rationale for your choices.
     

  10. Using The Distance Formula (Demo Video   Word Document Used in the Video)
    (There is nothing to hand in for this PCE.  Personally, I'd recommend doing a couple of examples by hand in order to make sure that you understand the formula.  You will be using the formula on homework assignment 2, et al.)
     
  11. PCE Feedback (Hand-In) (This will be graded)

Feedback: Printing of ranges could be more clear?

In-Class Exercises:
<Class Date: Oct 8th (Monday) >

 

Review /  Q + A
 

Preview:

  1. A2 Pre-test
     
  2. Reference Parameters (out, ref) , and normal return values
    You'll notice that this is the same as one of your pre-class exercises.  With a partner, go through, and discuss your answers, paying particular attention to the 'why does
    X make sense here, rather than Y or Z?' questions
  3. Design: return values vs. out vs. ref parameters (Sect. 7.14) (optional)
     
  4. Arrays: Basics (Sect. 8.1, 8.2)
  5. Arrays: Tracking grades in an array
     
  6. Multidimensional (Rectangular) Arrays (Sect. 8.10)
    DEMO Project: MultiDim Arrays
     
  7. Nested Loops: Multiplication Table (optional)

    references (basic)
Instructor's Materials:
Notes
Slides

 

Lesson 04
 
Individual Pre-Class Exercises:
<Due: Oct 15th (Monday)
 before the start of class (5:45pm  PST)>
  1. Nested Loops: Triangle of Numbers (Sect. 5.8) (Hand-In)
     
  2. Detecting Prime Numbers (Previous Knowledge) (Hand-In)
     
  3. Arrays: Basics (Sect. 8.1, 8.2)
  4. Arrays: Usage (Sect. 8.3)
  5. Arrays: Using only part of the array (Hand-In) 
  6. Fibonacci numbers in an array (Hand-In)
     
  7. Passing arrays to functions (Sect. 8.7, 8.8)
     

  8. Returning an array from a method
     
  9. Overloading: Basics (Sect. 7.12) (Hand-In) (Demo Video   VS Project Used in the Video )
  10. Overloading: Create your own (Sect. 7.12)
     
  11. PCE Feedback (Hand-In) (This will be graded)

references (basic)
References (more involved)
Feedback: More time discussing overloads?

Do a video on passing an array to/from a method - several people commented on this, it's not really covered in-class, and it's easy enough that (with some guidance) they can do it on their own.

In-Class Exercises:
<Class Date: Oct 15th (Monday) >

Review:

  1. Q+A

Preview:

  1. Basic OOP - objects & instance vars.   (Chapters 4, Chapters 9)
  2. Review of classes & instances (Ch 4, Sect. 4.3)
  3. Classes with instance data (Sect. 4.5)
  4. Access Control (public, private) (Sect.  9.3)
     
  5. String Allocation Exercise
    String Allocation Rules    
    (Sample Project For String Allocation Exercise)

  6. references & arrays
     
  7. Jagged Arrays: Tracking Grades
    Demo: Jagged Arrays (Upper-Tri Matrix)
  8. Jagged Arrays: Counting Arrays
Instructor's Materials:
Notes
Slides
 

 

Lesson 05

DUE: Assignment 2 (Due Monday, October 22nd)

Individual Pre-Class Exercises:
<Due: Oct 22 (Monday)
 before the start of class (5:45pm  PST) >
  1. OOP Basics:
    (Demo Video   Example Project)
    OOP Encapsulation:
    (Demo Video   Example Project)

    More Background Info:
       OOP Concepts (from Sun Microsystems - the Java People)
    (Focus on the "What is an Object?", "What is a class?", and "What is inheritance?" sections - the others are nice to read, but not mandatory)
     
  2. Classes & instances (Sect. 9.2)
     
  3. Instance Variables (Sect. 4.2+, Sect. 9.2)
  4. Access Control (public, private) (Sect. 9.3)
  5. Variable Scope (class, instance, local/param vars) (Sect. 7.11) (Hand-In)
     
  6. Designing a class: Circle (Ch 4)
  7. Testing a class: Circle (Hand-In) (In order to accomplish this, you will therefore need to do (and hand in) exercise #6, as well) (Ch 4)
     
  8. Constructors  (Sect 4.9, Sect. 9.6) (Hand-In)
     
  9. C# Properties  (Sect 4.5) (Hand-In)
  10. Read-only Properties
     
  11. String Allocation Exercise
    String Allocation Rules
    HowManyStrings.cs.txt
    String Allocation Practice -ANSWERS
     
  12. StringBuilder class
     

  13. PCE Feedback (Hand-In) (This will be graded)

Stuff to add for next time:

Passing an object to a method

returning an object from a method

references & arrays

references & arrays #2
 

references (more involved)
Feedback: Explain how you want multiple exercises within the same set of classes organized

Feedback: Instructions were hard to grasp, and could be more clear

Feedback: More precise instructions about what to do, exactly

In-Class Exercises:
<Class Date:  Oct 22 (Monday) >

Review:

  1. Q+A : Basic OOP (Methods + Data ; Encapsulation)
     
  2. Designing a class: Circle
  3. Testing a class: Circle
     

  4. StringBuilder review

Preview:

  1. Preview: Inheritance: 3D Point class
    Warning: The book mostly has a case study for the Inheritance aspects of OOP: you may need to supplement w/ help around more specific topics
     
  2. Inheritance: Basic Example (Chapter 10: Inheritance)
  3. Inheritance: Constructors
  4. Inheritance: Calling Methods in the base class
  5. Inheritance: Abstract base class
     
  6. Mixing Arrays and Classes: An array within a class (Previous Knowledge)   (Demo Video     Starter Project)
     
  7. Array of (possibly null) objects
     
  8. Object Composition (Triangle made of Points) (Sect. 9.8)
     
  9. A3 pre-test
Instructor's Materials:
Notes
Slides
 

 

Lesson 06

DUE: Assignment 3 (Due Monday, October 29th)

Individual Pre-Class Exercises:
<Due: Oct 29th (Monday)
 before the start of class (5:45pm  PST) >

  1. StringBuilder class (Hand-In)
    Name Game: Analyzing String Creation
    Name Game Project (VS 2003)
     

  2. Mixing Arrays and Classes: An array within a class (Previous Knowledge)  (Hand-In)  (Demo Video     Starter Project)
     

  3. OOP Inheritance (Specialization):
    (Demo Video   Example Project)
     

  4. Inheritance: Basic Example (Chapter 10: Inheritance) (Hand-In)
  5. Inheritance: Constructors
  6. Inheritance: Calling Methods in the base class (Hand-In)
  7. Inheritance: Abstract base class
     
  8. (Non)Inheritance: Array of objects (Hand-In)
     
  9. Inheritance: Polymorphism, manually (Chapter 11: Polymorphism)
     
  10. Basic Polymorphism
    (treat this a 'preview' - if you've got time, look at this so you'll be better prepared for class,
    but don't worry about it (or spend a lot of time on it) you get stuck)
     
  11. PCE Feedback (Hand-In) (This will be graded)

Feedback: Instructions were hard to grasp, and could be more clear

Feedback: Make it clear that they don't need a separate car class per exercise - use a 'template' like from PCE09/Ex1 to clarify this.

Feedback: More precise directions on #8, #10

In-Class Exercises:
<Class Date: Oct 29th (Monday) >

Review:

  1. Midterm Exam: Q+A & Review   (including inheritance)

Preview:

  1. Study Opt-Out
     
  2. Polymorphism: ToString Example
  3. Polymorphism: ToString on your Car class
     
  4. Optimization: StringBuilder
    DEMO: StringBuilder: First Try
     
  5. Time permitting: Composing a class out of other classes (Circle with a Point for a location)
  6. Time permitting: Overlap method
  7. Time permitting: Interaction between classes
Instructor's Materials:
Slides
 
 

 

Lesson 07

 

Individual Pre-Class Exercises:
<Due: Nov 5th (Monday)
 before the start of class (5:45pm  PST) >
  1. Review for the exam!
     

  2. Optimization: StringBuilder (Hand-In)
    DEMO: StringBuilder: First Try
     

  3. Polymorphism Preview

  4. Basic Polymorphism (Hand-In)
  5. Polymorphism: ToString (Hand-In)
     
  6. Study Opt-Out
    (You need to read this; there is no 'work' for you to do here)
    (You should NOT inform the instructor if you choose to opt out!!!)

     
  7. PCE Feedback (Hand-In) (This will be graded)

TODO: Given a simple example, and some rules of thumb, extract several classes from a narrative
One of the classes will be composed (in part) of instance from another class.

Feedback: More details on stringbuidler

Feedback: Re-start the examples, using something different than the parking garage scenario.

Feedback: Provide a pre-done PCE06 basis, so that people can work on this even if their PCE06 didn't quite work? Also - the Cars code have a fair amount of 'printing' routines already, so Print2 doesn't come across as being distinct

Feedback: The 'ToString' example's last paragraph is unclear, and appears to duplicate earlier work that students have done.

Feedback: Be clear about whether copy-and-paste-and-edit, or an in-place edit of existing (prior PCE) stuff is ok.  Make it clear that adding ToString to the existing Car classes is ok (rather than having 1 for Print2, and another copy for ToString)

Feedback: For #4, students are asked how the code differs, but it's not clear what to look for.  The output is the same, and the code may or may not have been done correctly (if not correct, it may resemble the ParkingGarage of the previous PCE)

Feedback: Explain more about StringBuilder & it's uses

In-Class Exercises:
<Class Date:
Nov 5th (Monday) >

  1. <Midterm Exam>
     
  2. Recursion By hand: Warm-up #1
  3. Recursion By hand: Warm-up #2

 

Instructor's Materials:
Notes
Slides

 

Lesson 08

DUE: Assignment 4 (Due Monday, November 12th, even though Cascadia is closed!!!! )

VETERAN'S DAY - CASCADIA CLOSED

Individual Pre-Class Exercises:
<Due: Nov 12th (Monday)
 before the start of class (5:45pm  PST) >

  1. What does this code print? (Hand-In)
     
  2. Recursion By hand: Warm-up #1
  3. Recursion By hand: Warm-up #2 (Hand-In)
  4. Recursion By hand: Warm-up #3 (Hand-In)
     
  5. Basic (Crashing) Recursion (Sect. 7.13)
  6. Basic Recursion (Sect. 7.13) (Hand-In) CAP
     
  7. Object Allocation Exercise
    Object Allocation Rules
    HowManyObjects.cs.txt
    <Answers to be gone over in class>
     
  8. Polymorphism: virtual, override, new (Read Briefly) Polymorphism: All combinations of baseRef, derivedRed, baseObj, derived Obj
    File: Inheritance.zip

     
  9. A2 Skills post-test (Hand-In) (Due by Friday, November 9th, at 5pm) (Save this document, fill it out, then EMAIL it to the professor)
    A2 Attitude Survey (Required - this is an online survey, so you won't 'hand in' anything)  (Due by Friday, November 9th, at 5pm)
     
  10. A4 Skills pre-test (Hand-In) (Due BEFORE you start work on A4, and no later than Friday, November 9th, at 5pm)
     
  11. PCE Feedback (Hand-In) (This will be graded)

Feedback: Many/most people liked the 'by hand' recursion exercises

Feedback: Smaller code blocks, with more repetition, might be good.

Feedback: Make it more clear why we care how many objects there are

In-Class Exercises:
<Class Date: Nov 14th (Wednesday) >

Review:

  1. Recursion By hand: Warm-up #2
  2. Recursion By hand: More Complicated

Previews:

  1. Recursive Power Function
  2. Recursive Multiplication
  3. Fibonacci Numbers (And Arrays!)
     
  4. Counting objects (review, solution)
     
  5. A3 Skills post-test
  6. A3 Attitude Survey
Instructor's Materials:
Notes
Slides   

 

Lesson 09

 

Individual Pre-Class Exercises:

<Due: Nov 19th  (Monday) before the start of class (5:45pm  PST)  >

  1. Recursively Printing Even Numbers (Hand-In)
    PCE Example Format
  2. Recursive Power Function
  3. Recursive Multiplication (Hand-In)
  4. Write Factorial
  5. Fibonacci Numbers (And Arrays!)
     
  6. Sorting & Searching: setup for the class (Hand-In)
     
  7. Object Allocation Exercise (Hand-In)
    Object Allocation RulesHowManyObjects2.cs.txt
     
  8. PCE Feedback (Hand-In) (This will be graded)
     
  9. A3 Skills post-test  (Hand-In) (Email this to your instructor by Friday, November 9th, at 5pm)
  10. A3 Attitude Survey  (Required - this is an online survey, so you won't 'hand in' anything)  (Due by Friday, November 9th, at 5pm)

Feedback: Ex 7 (Obj Alloc) - very long, 2 loops made it very time consuming

Feedback: Ex 3 - put in a reminder that the parameter can be either positive or negative

Feedback: Make it clear that Ex 6 is NOT intended to be a recursive exercise.  One person even commented - make it more challenging

Feedback: More repetition on recursion would be awesome!

Feedback: Make it more clear why we care how many objects there are

Feedback: Have some way for students to check their work on the 'object counting' exercises - maybe list a total number of objects created, so students can 'checksum' their answer?

In-Class Exercises:
<Class Date: Nov 19th  (Monday) >

Review:

  1. Recursion

Preview:

  1. Linear Search By Hand

  2. Binary Search By Hand

  3. Bubble Sort By Hand
  4. Selection Sort (Algorithm, and by hand)
     

  5. Homework Q + A

Videos:

  1. Due Dates, Binary Search

  2. BubbleSort

  3. SelectionSort
Instructor's Materials:
Notes

Slides   

 

Lesson 10
Individual Pre-Class Exercises:
<Due: Nov 26th (Monday)  before the start of class (5:45pm  PST)  >
  1. StringBuilder Tutorial (Required)
    Example Project #1            Example Project #2             Example Project #3              Example Project #4
     
  2. Linear Search
    PCE Example Format (In 2007Fa, these were split into two files, in an attempt to make it more clear what the expectations were about the PCE's file format.  As long as it's clear where your exercises are, the 2007Fall students do not need to adhere to these changes)
     
  3. Binary Search
  4. Write recursive binary search
  5. Linear Search: Measuring Performance (Hand-In)
  6. Binary Search: Measuring Performance (Hand-In) (This doesn't have to be recursive)
  7. BubbleSort
  8. BubbleSort: Measuring Performance (Hand-In)
  9. Analyzing the different algorithms (Hand-In) (Demo Video: Scatter Plots in Excel)
     
  10. PCE Feedback (Hand-In) (This will be graded)

Feedback: Put spaces between the paragraphs to better separate them?

Feedback: Clarify what counts as a comparison - in Binary Search, it's each time through the loop (rather than once per 'if' statement)

Feedback: Mention that BubbleSort is quick+easy, but very inefficient - it's good to consider better sorting algorithms for any substantially sized work

Feedback: Include another sorting method, to compare against BubbleSort?

Feedback: Pseudocode for the recursive find integer binary search might be good.

 

In-Class Exercises:

<Class Date: Nov 26th (Monday) >

 

  1. CIEs!
     
  2. Quizzes + Final Exam: Q+A & Review
     
  3. A4 Skills post-test
    A4 Attitude Survey
     
  4. < Algorithms Review >
    Runtimes.xls
     
  5. Big "Oh" Notation
     
  6. Using .Net's Array.Sort, Array.Search
     

  7. UWB-CSS presentation

Instructor's Materials:
Notes
Slides

 

Lesson 11

Individual Pre-Class Exercises:
<Due: Dec 3rd (Monday)
before the start of class (5:45pm  PST)  >

  1. Review for the exam
     

  2. A4 Skills post-test (Hand-In) (Email this to your instructor no later than Friday, Nov 30th, at 5pm)
    A4 Attitude Survey (Required - this is an online survey, so you won't 'hand in' anything)  (Due by Friday, Nov 30th, at 5pm)

In-Class Exercises:
<Class Date: Dec 3rd (Monday) >

  1. <Final Exam>

Instructor's Materials:
Slides

Back to BIT 142's homepage

Unused Lecture Material

BIT 143's Lessons Page

TODO

Add more about 'class design' - figuring out what properties / methods something should have.  Also, more on how to create classes that interact with each other